PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 17, 2022

[FIXED] Why in overleaf I miss a vertical edges in the table?

 November 17, 2022     latex, vertical-alignment     No comments   

Issue

enter image description here

I am new in Latex, I create a table

    \begin{table}[!ht]
  \centering
  \caption{Cities analyzed in this study}
  \begin{adjustbox}{max width=\textwidth}
  \begin{tabular}{|l|c|c|c|c|c|c|c|c|c|}
    \hline
    City & Number of & Number of  & \multicolumn{2}{c}{Transportation type}  \\
    \cline{4-9}
    & stations & routes & Bus & Tram & Subway&Rail&Ferry& Cable-car \\
    \hline
    Adelaide & 7548 & 9234 & 8950 &54 & - & 230 & -&- \\
     \hline

But in the top right, the vertical line is not showing. How can I make it appear? My second question how can I put 'Transportation type' on the center of the cell?


Solution

You can add the missing edge by using \multicolumn{6}{c|}{...}, but before you actually use this, please have a look at http://betterposters.blogspot.com/2012/08/the-data-prison.html or https://www.inf.ethz.ch/personal/markusp/teaching/guides/guide-tables.pdf for some guides about nice table layouts. Using vertical lines is really bad style.

Please also don't scale elements that contain text. This will make result in a suboptimal usage of font shapes. If you must make your table smaller, manually choose an appropriate font size.

\documentclass{article}

\begin{document}

    \begin{table}[!ht]
  \centering
  \caption{Cities analyzed in this study}
  \begin{tabular}{|l|c|c|c|c|c|c|c|c|c|}
    \hline
    City & Number of & Number of  & \multicolumn{6}{c|}{Transportation type}  \\
    \cline{4-9}
    & stations & routes & Bus & Tram & Subway&Rail&Ferry& Cable-car \\
    \hline
    Adelaide & 7548 & 9234 & 8950 &54 & - & 230 & -&- \\
     \hline
     \end{tabular}
     \end{table}

\end{document}


Answered By - samcarter_is_at_topanswers.xyz
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing