Tables – How to Remove Only Half the Space Between Two Columns in Tabular

tables

In a tabular without vertical lines, how to remove only half of the space between two columns?

Here: How to get the space between "e" and "f" equal to the space between "i" and "j"?

MWE:

\documentclass{article}

\begin{document}

\begin{tabular}{r|l}
a & b
\end{tabular}

\begin{tabular}{rl}
c & d
\end{tabular}

\begin{tabular}{r@{}l}
e & f $\leftarrow$ both column seperators deleted instead of only one
\end{tabular}

\begin{tabular}{r@{}@{}l}
g & h
\end{tabular}

\begin{tabular}{r@{}|l}
i & j
\end{tabular}

\end{document}

Best Answer

By default, LaTeX inserts whitespace padding in the amount of 2\tabcolsep between the columns of tabular, tabular*, longtable, tabularx, and tabulary environments. In all LaTeX document classes I'm familiar with, the default value of \tabcolsep is 6pt.

If you want a given intercolumn space to be half as wide as the default, just write @{\hspace{\tabcolsep}} as the specifier for the intercolumn space in question. On the other hand, if you want all intercolumn whitespace padding to be half as wide as the default, just write \setlength{\tabcolsep}{3pt}.

enter image description here

\documentclass{article}
\begin{document}

\begin{tabular}{cc}
x & x
\end{tabular}

\begin{tabular}{c@{\hspace{2\tabcolsep}}c} % same outcome as above
x & x
\end{tabular}

\begin{tabular}{c@{\hspace{\tabcolsep}}c}
x & x
\end{tabular}

\begin{tabular}{c@{}c}
x & x
\end{tabular}

\end{document}