latex - 为什么在背面我错过了表格中的垂直边缘?
问题描述
我是 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.html或https://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}
推荐阅读
- ios - Xcode 12.2:调试器不使用断点
- sqlite - Row_Number() 函数在 sqlite 版本 3.5.1 中不起作用
- javascript - vue.js 中的动态背景图片
- python - 在 macOS BigSur 上使用自制 python 安装 numpy 的问题
- assembly - 终端打印一个“?” x86减法运算中的字符
- nginx - 在 CentOS 7.9 中安装 epel 后没有可用的软件包 nginx
- php - 处理多种场景运费计算和数据存储
- java - Java逻辑错误:继续运行相同的菜单
- reactjs - 如何创建嵌套组件?
- c# - 如何使用返回的 cookie 发出获取请求?