0

I can separate columns in my tables with lines by adding a | at the beginning as in \begin{tabular}{ |l|l| }.

How do I separate columns with space such that it's aligned as done in the following table?

enter image description here

Solution that worked for me:

 \begin{longtable}[c]{ll@{\hspace{30pt}}ll}
 \multicolumn{2}{}{}
 \hline
 MNIST &  & CIFAR-10  & \\

 \hline
 \endfirsthead
 \hline
 \endlastfoot

 Conv.ReLU & 3 x 3 x 32 & Conv.ReLU & 3 x 3 x 96\\
 Conv.ReLU & 3 x 3 x 32 & like this\\
 Max Pooling & 2 x 2 & like this\\
 Conv.ReLU & 3 x 3 x 64 & like this\\
 Conv.ReLU & 3 x 3 x 64 & like this\\
 Max Pooling & 2 x 2 & like this\\
 Dense.ReLU & 200 & like this\\
 Dense.ReLU & 200 & like this\\
 Softmax & 10 & like this\\

 \end{longtable}
6
  • 4
    ll instead of |l|l| then.
    – user156344
    Commented Mar 2, 2019 at 13:56
  • Note how the table has 4 columns, and the space between columns 2,3 is greater than the space between columns 1,2 and 3,4. How can I do that?
    – PlsWork
    Commented Mar 2, 2019 at 14:00
  • @AnnaVopureta It depends on how the table columns are defined, please add a minimal but complete example of your code which creates this table.
    – CarLaTeX
    Commented Mar 2, 2019 at 14:03
  • 1
    {l@{\quad}l@{\qquad}l@{\quad}l}.
    – Bernard
    Commented Mar 2, 2019 at 14:04
  • @AnnaVopureta If you want to customize the width of the columns, p{3cm}p{4cm}p{2in} then. You only have to get rid of the |. To get rid of the space between columns, use @{} as the accepted answer stated.
    – user156344
    Commented Mar 2, 2019 at 14:31

1 Answer 1

3

You can adjust the spacing beween individual columns to your liking using @{<length>} as shown in the following MWE:

\documentclass{article}

\begin{document}

\begin{tabular}{ll@{\hspace{20pt}}ll}
1 & 2 & 3 & 4\\
\end{tabular}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .