LaTeX Making Vertical Lines in Table - Latex

  • Thread starter Thread starter Rajini
  • Start date Start date
  • Tags Tags
    Line Pipe Table
AI Thread Summary
To create a continuous vertical line in a LaTeX table, an additional empty column can be added to the tabular environment. The original code resulted in a broken vertical line after the "2 col" header. By modifying the column specification to include an empty column, the vertical line appears continuous. This adjustment effectively resolves the issue with the table's formatting. Implementing this simple trick can enhance the visual consistency of LaTeX tables.
Rajini
Messages
619
Reaction score
4
Dear all,
I want to make a vertical line in table..
I use this following latex codes
Code:
\begin{table}[h]
\caption{Some caption.}\label{namelab}
\vspace{2mm}
\centering
\begin{tabular}[width=1\textwidth]{ll|cccc}
\hline\hline
\multicolumn{2}{c}{2~col} & par~1 & par~2 & par~3 & par~4\\
\hline
1 & at RT                 & 56   & d1    & 0.25 & 0.3\\
  & 4.2~K                 & 59   & d2    & 0.25 & 0.2\\
\hline\hline
\end{tabular}
\end{table}
When i compiled it i got a good table..but the vertical line is not continuous..please see the figure attached..no line after '2 col'.
Thanks for your help
 

Attachments

Physics news on Phys.org
yeah i don't think it works well, you can fix it by adding another column, empty:

Code:
\begin{table}[h]
\caption{Some caption.}\label{namelab}
\vspace{2mm}
\centering
\begin{tabular}[width=1\textwidth]{lll|cccc}
\hline\hline
\multicolumn{2}{c}{2~col}&& par~1 & par~2 & par~3 & par~4\\
\hline
1 & at RT               && 56   & d1    & 0.25 & 0.3\\
  & 4.2~K               && 59   & d2    & 0.25 & 0.2\\
\hline\hline
\end{tabular}
\end{table}
 
oh..thanks..
simple trick!
 

Similar threads

Replies
3
Views
2K
Replies
9
Views
2K
Replies
1
Views
2K
Replies
3
Views
3K
Replies
5
Views
6K
Replies
2
Views
6K
Back
Top