[英]Why in overleaf I miss a vertical edges in the table?
我是 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.Z437175BA4191210EE004E1D93744指導一些漂亮的表格布局。 使用垂直線是非常糟糕的風格。
也請不要縮放包含文本的元素。 這將導致字體形狀的使用不理想。 如果您必須縮小表格,請手動選擇合適的字體大小。
\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}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.