Making Vertical Lines in Table - Latex

  • Context: LaTeX 
  • Thread starter Thread starter Rajini
  • Start date Start date
  • Tags Tags
    Line Pipe Table
Click For Summary
SUMMARY

The discussion focuses on creating vertical lines in LaTeX tables, specifically addressing an issue where the vertical line is not continuous after a merged cell. The user initially provided a LaTeX code snippet that resulted in a broken vertical line. A solution was proposed, which involved adding an additional empty column to the tabular environment. This adjustment successfully created a continuous vertical line in the table.

PREREQUISITES
  • Familiarity with LaTeX table syntax
  • Understanding of the tabular environment in LaTeX
  • Knowledge of the \multicolumn command in LaTeX
  • Basic LaTeX compilation process
NEXT STEPS
  • Explore advanced LaTeX table formatting techniques
  • Learn about the use of the booktabs package for better table aesthetics
  • Research the \cline command for partial horizontal lines in tables
  • Investigate the use of multirow and multicolumn features in LaTeX
USEFUL FOR

LaTeX users, academic writers, and anyone involved in document preparation who needs to create well-structured tables with continuous vertical lines.

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 0 ·
Replies
0
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 2 ·
Replies
2
Views
6K