# Adding space between columns in a table

I notice that the space between each column of a table in LaTeX is not quite wide (at least for me). Is there any way to set this? I found the \hspace, but I don't get how to use this in the table.

ADDED: Found the answer! put \renewcommand{\tabcolsep}{3cm} (the 3cm is just an example) if you want to change the space in all table. If you want to change it on one or several, Stefan's answer will be the best.

-
Ups, just found the answer... You can lock this post. –  zfm Apr 24 '11 at 22:34
@zfm: In such cases, it would be great if you would post the answer you found yourself, for other interested readers. –  Stefan Kottwitz Apr 24 '11 at 22:37
@Stefan: exactly the same as yours, sorry for not posting it :) Well I found something bit more general. If we want that this \tabcolsep changed everywhere, we can do \renewcommand{\tabcolsep}{0.15cm} –  zfm Apr 24 '11 at 22:40
@zfm: No, \renewcommand{\tabcolsep}{...} is definitely wrong; the correct way is with \setlength. –  egreg Apr 24 '11 at 22:55
@egreg: that's wrong? why? when I try it, I see that the space between column is added –  zfm Apr 25 '11 at 8:23

The parameter to act on is \tabcolsep, whose value is usually 6pt. So

\setlength{\tabcolsep}{12pt}


will double the intercolumn space. The parameter stores half the space between columns: in LaTeX each column is preceded and followed by a horizontal space \tabcolsep wide.

-

You can add space by inserting @{\hskip whatever} between the column specifiers, as in

\begin{tabular}{l@{\hskip 1in}c@{\hskip 0.5in}c}
One&Two& Three\\
Four& Five& Six
\end{tabular}


Actually, you can add whatever you like between the columns in place of the usual intercolumn space, e.g.,

\begin{tabular}{l@{ or }c@{\hskip 0.5in}c}
One&Two& Three\\
Four& Five& Six
\end{tabular}

-
Really interesting, thanks. For anyone else, if discovered: \hskip defines the horizontal space, it is not additional to any other measure. E.g. @{\hskip -0.1cm} produces a bad output (just test it). –  henry Aug 5 '13 at 13:13

You can adjust the length \tabcolsep, for example:

\documentclass{article}
\begin{document}
\centering
\begin{tabular}{cc}
text & text
\end{tabular}
\setlength{\tabcolsep}{3em}

\begin{tabular}{cc}
text & text
\end{tabular}
\end{document}


\tabcolsep is the space which is inserted before and after a column. Note, this means that the space between two columns is 2\tabcolsep.

-
This is exactly what I got just 30 seconds before your post. Thanks anyway! –  zfm Apr 24 '11 at 22:37
@stefan How can I specify a particlular tabcolsep for only one column using pgfplotstabletypeset –  Nicholas Hamilton Aug 26 '13 at 0:54
@ADP It seems like this could be posted as a new question, since this question is not about one column only and not related to pgfplots. –  Stefan Kottwitz Aug 26 '13 at 7:09