为什么在下页中我错过了桌子的垂直边缘?

问题描述

enter image description here

我是Latex的新手,我创建了一个表格

    \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

但是在右上角没有显示垂直线。如何使其显示? 我的第二个问题是如何将“运输类型”放在单元格的中心?

解决方法

您可以使用\multicolumn{6}{c|}{...}添加缺失的边缘,但是在实际使用此边缘之前,请查看http://betterposters.blogspot.com/2012/08/the-data-prison.htmlhttps://www.inf.ethz.ch/personal/markusp/teaching/guides/guide-tables.pdf以获得一些有关表格布局的指南。使用垂直线确实是不好的样式。

也请不要缩放包含文本的元素。这将导致字体形状使用不佳。如果必须缩小表格大小,请手动选择适当的字体大小。

\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}

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...