[Tex/LaTex] Breaking Horizontal Rule Running Across Adjacent Columns in a Table

rulestables

Is there any way to force a break in the horizontal rule running across two adjacent cells of a table. To be more precise, here is what I'm looking for:

enter image description here

Notice how I wish the lines to fall short of the left and right borders of the table as well. I would really appreciate it if someone can provide a simple and compact solution.

This is the usual scenario for comparing against:

enter image description here

Here is the simple code for quick access:

\begin{tabular}{ccccc}
\hline
\multirow{2}{*}{C1} & \multicolumn{2}{c}{C2} & \multicolumn{2}{c}{C3} \\ \cline{2-3} \cline{4-5}
                    & C21 & C22              & C31 & C32            \\ \hline
Val1                & Val2 & Val3            & Val4 & Val5 \\ 

\end{tabular}

Best Answer

You could use the booktabs package:

enter image description here

Code:

\documentclass{article}
\usepackage{multirow}
\usepackage{booktabs}

\begin{document}
\begin{tabular}{ccccc}
\hline
\multirow{2}{*}{C1} & \multicolumn{2}{c}{C2} & \multicolumn{2}{c}{C3} \\ 
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
                    & C21 & C22              & C31 & C32            \\ 
\cmidrule(lr){1-1} \cmidrule(lr){2-3} \cmidrule(lr){4-5}
Val1                & Val2 & Val3            & Val4 & Val5 \\ 

\end{tabular}
\end{document}
Related Question