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

3
  • is it something to do with centered cell alignment? if so, this might help you: tex.stackexchange.com/questions/7208/… Aug 27, 2018 at 7:35
  • @Raaja Thanks for your suggestion, but it was not help me to meet the requirement, anyway, thanks a lot....
    – MadyYuvi
    Aug 27, 2018 at 9:43
  • Can you please tell what's the use of this?
    – egreg
    Aug 28, 2018 at 20:38

1 Answer 1

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .