Graphics, Figures & Tablesvertical lines & multicolumn in tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
steem84
Posts: 9
Joined: Fri Dec 18, 2009 2:09 pm

vertical lines & multicolumn in tables

Post by steem84 »

Hi there,

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:
table-multicolumn.png
table-multicolumn.png (5.21 KiB) Viewed 16315 times
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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

vertical lines & multicolumn in tables

Post by localghost »

You better upload attachments to the forum server because external links can get lost with time. Furthermore there is the »Code« environment for posting code.

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
steem84
Posts: 9
Joined: Fri Dec 18, 2009 2:09 pm

Re: vertical lines & multicolumn in tables

Post by steem84 »

ok, I will keep in mind the board rules for the next time.

Thanks for the answer
Post Reply