0

I want to increase the distance between number in each row in the following code. May you please provide a guidance.

\begin{document}
\begin{center}
   
\begin{tabular}{ccc}
17 13 18 19 17 21 29 22 16 28 21 15& & \\[0.25cm]  
26 23 24 20 8 17 17 21 32 18 25 22 & & \\[0.25cm] 
16 10 20 22 19 14 30 22 12 24 28 11 \\[0.25cm] 
\end{tabular}
\end{document}strong text

\end{center}
3
  • you have a three column table but columns two and three are empty, do you want the numbers to align use & between each number and declare more columns eg \begin{tabular}{*{15}{c}} Dec 17, 2021 at 21:18
  • I need a three row table with a little more distance between numbers
    – user118746
    Dec 17, 2021 at 21:26
  • yes but I was asking about columns not rows, the data looks like it ought to be 15 columns, but all the data is in one column and then you have two empty columns Dec 17, 2021 at 21:59

2 Answers 2

1

In the argument to tabular you don't specify the number of rows, but the number of columns.

Your table should be

\begin{tabular}{@{} *{12}{r} @{}}
17 & 13 & 18 & 19 & 17 & 21 & 29 & 22 & 16 & 28 & 21 & 15 \\[0.25cm]
26 & 23 & 24 & 20 &  8 & 17 & 17 & 21 & 32 & 18 & 25 & 22 \\[0.25cm]
16 & 10 & 20 & 22 & 19 & 14 & 30 & 22 & 12 & 24 & 28 & 11
\end{tabular}

The meaning of @{} at the beginning and end is “don't add the standard padding” (they can be removed, though, if the table doesn't end up too wide).

With *{12}{r} we specify twelve columns with right alignment. You might prefer centering, but the 8 in row two, column five, would appear misaligned, to my eyes.

Full code.

\documentclass{article}

\begin{document}

\begin{center}
\begin{tabular}{@{} *{12}{r} @{}}
17 & 13 & 18 & 19 & 17 & 21 & 29 & 22 & 16 & 28 & 21 & 15 \\[0.25cm]
26 & 23 & 24 & 20 &  8 & 17 & 17 & 21 & 32 & 18 & 25 & 22 \\[0.25cm]
16 & 10 & 20 & 22 & 19 & 14 & 30 & 22 & 12 & 24 & 28 & 11
\end{tabular}
\end{center}

\end{document}

enter image description here

Alternative

Here's a different way of handling the table. Since these are numbers, math mode would be preferable, so you could use a math display. You can also reduce the spacing to your liking.

\documentclass{article}

\begin{document}

\[
\setlength{\arraycolsep}{0.15cm}
\begin{array}{@{} *{12}{r} @{}}
17 & 13 & 18 & 19 & 17 & 21 & 29 & 22 & 16 & 28 & 21 & 15 \\[0.25cm]
26 & 23 & 24 & 20 &  8 & 17 & 17 & 21 & 32 & 18 & 25 & 22 \\[0.25cm]
16 & 10 & 20 & 22 & 19 & 14 & 30 & 22 & 12 & 24 & 28 & 11
\end{array}
\]

\end{document}

Adjust the values for the horizontal and vertical spacing until you're satisfied.

enter image description here

0
  • your MWE is erroneous. I suppose that end of your MWE should be:
...
\end{tabular}
\end{center}
strong text

\end{document}
  • your table has three columns, the first is the string of 12 numbers and the last two are empty.
  • It is not clear, if you like to have only bigger space between numbers in string or you also like to have numbers horizontally aligned.
  • in the first case you can use Gonzalo Medina answer on this question, for example in your case:
\documentclass{article}
\usepackage{lipsum}

\begin{document}
    \begin{center}
\spaceskip=3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font
\begin{tabular}{ccc}
17 13 18 19 17 21 29 22 16 28 21 15 & a & b \\
26 23 24 20  8 17 17 21 32 18 25 22 & c & d \\
16 10 20 22 19 14 30 22 12 24 28 11 & e & f \\
\end{tabular}
    \end{center}
strong text
\end{document}

which produce:

enter image description here

  • or break the first column into 12 columns:
\documentclass{article}
\usepackage{lipsum}

\begin{document}
\lipsum[66]
    \begin{center}
\spaceskip=3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font
\begin{tabular}{*{12}{c} cc}
17 & 13 & 18 & 19 & 17 & 21 & 29 & 22 & 16 & 28 & 21 & 15 & a & b \\
26 & 23 & 24 & 20 &  8 & 17 & 17 & 21 & 32 & 18 & 25 & 22 & e & f \\
16 & 10 & 20 & 22 & 19 & 14 & 30 & 22 & 12 & 24 & 28 & 11 & e & f \\
\end{tabular}
    \end{center}

\end{document}

enter image description here

In both examples, I add letters in the last two columns that can be seen from their presence in table.

You must log in to answer this question.

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