3

When I reduce the table's horizontal padding using @{}, the \cline command does not work properly anymore. It is shown in the MWE below.

\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|c|}
\hline
Text & Text & Text \\ \cline{2-3}
Text & Text & Text \\ \hline
\end{tabular}
\vspace{1cm}
\begin{tabular}{|@{\hspace{1mm}}c@{\hspace{1mm}}|@{\hspace{1mm}}c@{\hspace{1mm}}|@{\hspace{1mm}}c@{\hspace{1mm}}|}
\hline
Text & Text & Text \\ \cline{2-3}
Text & Text & Text \\ \hline
\end{tabular}
\end{document}

enter image description here

4

Instead of specifying (half the) intercolumn whitespace by hand in each and every case, you may want to simply redefine the parameter \tabcolsep. That way, the issue with the misaligned \cline will take care of itself automatically, and I dare say the code becomes a lot more readable to boot.

enter image description here

\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{|@{\hspace{1mm}}c@{\hspace{1mm}}|
                 @{\hspace{1mm}}c@{\hspace{1mm}}|
                 @{\hspace{1mm}}c@{\hspace{1mm}}|}
\hline
Text & Text & Text \\ \cline{2-3}
Text & Text & Text \\ \hline
\end{tabular}

\smallskip 
\renewcommand{\tabcolsep}{1mm}
\begin{tabular}{|c|c|c|}
\hline
Text & Text & Text \\ \cline{2-3}
Text & Text & Text \\ \hline
\end{tabular}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.