[Tex/LaTex] Changing height of vertical line in tabular

rulestables

Is there any way of changing the height of the vertical lines of a tabular environment?

Here is my MWE:

\begin{tabular}{|c|c|}
\multicolumn{2}{|c|}{Header 1}\\
Subheader 1 & Subheader 2 \\ \hline
Cell 1 & Cell 2 \\ \hline
\end{tabular}

which generates:

enter image description here

However, I'd like to have the vertical line between Subheader 1 and Subheader 2 a bit shorter.

Best Answer

You can use the ! feature of the array package, together with \vline; however, it would be better not using vertical rules at all, as shown in the second table.

\documentclass{article}
\usepackage{array} % necessary for the shorter rule
\usepackage{booktabs} % for the second example
\begin{document}

\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{Header 1}\\
\multicolumn{1}{|c!{\vline height .8\ht\strutbox}}{Subheader 1} & Subheader 2 \\
\hline
Cell 1 & Cell 2 \\
\hline
\end{tabular}

\bigskip

\begin{tabular}{cc}
\toprule
\multicolumn{2}{c}{Header 1} \\
\addlinespace
Subheader 1 & Subheader 2 \\
\midrule
Cell 1 & Cell 2 \\
\bottomrule
\end{tabular}

\end{document}

enter image description here