3

My code are follows:

\documentclass{book}

\begin{document}

\begin{tabular}{c|l}
Test &Trial\\
Trial &Test\\
& Test
\end{tabular}

\end{document}

Vertical rule should be on the exact top and bottom of the table, is it possible to fix? Please advise...

enter image description here

TeXnician
  • 33,589
MadyYuvi
  • 13,693

1 Answers1

3

This "misalignment" is due to the linespace of your document. You could decrease the space be putting the table in a spacing environment as follows:

\documentclass{book}
 \usepackage{setspace}

\begin{document}

Before:

\begin{tabular}{c|l}
\hline
Test &Trial\\
Trial &Test\\
& Test \\
\hline
\end{tabular}


After:

\begin{spacing}{0.5}
 \begin{tabular}{c|l}
    \hline
    Test &Trial\\
    Trial &Test\\
    & Test \\
    \hline
 \end{tabular}
\end{spacing}

\end{document}

Note, that I inserted \hlines for better visualisation.