1

There is a slight offset of alignment of the right column header (which is a multicolumn entry) and the column to which it is supposed to be left-aligned below. If the @{\hspace{1em}} is removed from the tabular, the columns line up great, but as long as there's an \hspace or \hskip there, the second column's multicolumn header is slightly offset.

How can I add space between columns without ruining the alignment?

\documentclass{article}

\begin{document}

\begin{tabular}{ll@{\hspace{1em}}ll}
\multicolumn{2}{l}{multicolumn header 1} & \multicolumn{2}{l}{I, too, am a multicolumn header 2}\\
\hline
Thing 1 &   ‘I am a quote’ & Thing 4 & ‘Last column, cell 1’\\
Thing 2 &   ‘I am quote 2’ & Thing 5 & ‘Last column, cell 2’\\
Thing 3 &   ‘I am quote 3’ & Thing 6 & ‘Last column, cell 3’\\
\end{tabular}

\end{document}

Table with misaligned second column

2

You have to manually suppress the insertion of the default \tabcolsep before the second \multicolumn using @{}.

\documentclass{article}

\begin{document}

\begin{tabular}{ll@{\hspace{1em}}ll}
\multicolumn{2}{l}{multicolumn header 1} & \multicolumn{2}{@{}l}{I, too, am a multicolumn header 2}\\
\hline
Thing 1 &   ‘I am a quote’ & Thing 4 & ‘Last column, cell 1’\\
Thing 2 &   ‘I am quote 2’ & Thing 5 & ‘Last column, cell 2’\\
Thing 3 &   ‘I am quote 3’ & Thing 6 & ‘Last column, cell 3’\\
\end{tabular}

\end{document}

enter image description here

| improve this answer | |
  • Interesting. I'm not familiar enough with the internals of tabular (by which I mean not really familiar at all) to know exactly why tabcolsep needs to be suppressed before the second multicolumn, but I'll try to read up on it and, in the meantime, just use this as the fix. Thanks! – drewx0r Dec 9 '19 at 0:52
  • @drewx0r If you type l, LaTeX will insert \tabcolsep on the left and right of that column, unless there is @{...} on that side. – Henri Menke Dec 9 '19 at 2:02
0

Why not add some blank columns in between?

enter image description here

\documentclass{article}

\begin{document}

\begin{tabular}{llllll}
\multicolumn{2}{c}{multicolumn header 1} &&& \multicolumn{2}{c}{I, too, am a multicolumn header 2}\\
\hline
Thing 1 &   ‘I am a quote’ & &&Thing 4 & ‘Last column, cell 1’\\
Thing 2 &   ‘I am quote 2’ & &&Thing 5 & ‘Last column, cell 2’\\
Thing 3 &   ‘I am quote 3’ &&&Thing 6 & ‘Last column, cell 3’\\
\end{tabular}

\end{document}
| improve this answer | |

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.