Graphics, Figures & Tables ⇒ vertical lines & multicolumn in tables
vertical lines & multicolumn in tables
I observed that after using \multicolumn in the table enviroment, a vertical line is not visible in that row. Here is an example:
\begin{table}
\centering
\begin{tabular}{ll||ccc|ccc|ccc||c|c}
\hline
&& \multicolumn{6}{c}{experiments} & \multicolumn{3}{c}{simulation} & x & y \\
\hline
1 & 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
1 & 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
\end{tabular}
\end{table}
and the result: However, the double line is not visible after the word 'simulation', and that is what I wanted. How to do this ?
Thanks in advance!
Steven
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
vertical lines & multicolumn in tables
The \multicolumn command accepts in its second argument the same column settings as they are in the table head. Modify your code as shown below.
Code: Select all
\begin{table}[!ht]
\centering
\begin{tabular}{ll||ccc|ccc|ccc||c|c} \hline
& & \multicolumn{6}{c}{experiments} & \multicolumn{3}{c||}{simulation} & x & y \\\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
\end{tabular}
\end{table}
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: vertical lines & multicolumn in tables
Thanks for the answer