1

I have the following table. I need to have the same width for all columns except the first one. Could you help me, please?

\begin{minipage}{\linewidth}
\centering
\captionof{table}{label}
\label{table}
\begin{tabular}{|c|c|c|c|c|c|c|}
    \hline
    Name                     & 1& 2& 3& 4& 5& 6 \\ \hline
    USA                      & 1      & 1    & 1        & 2        & 22   & 6          \\
    Italy                    & 2      & 6    & 6        & 4        & 11   & 10         \\
    UK                       & 3      & 30   & 3        & 1        & 9    & 9          \\
    Canada                   & 4      & 10   & 7        & 12       & 74   & 37         \\
    Spain                    & 5      & 3    & 2        & 3        & 1    & 1          \\
    Switzerland              & 6      & 5    & 5        & 6        & 35   & 44         \\
    Netherlands              & 7      & 4    & 8        & 11       & 17   & 14         \\
    Romania                  & 10     & 14   & 17       & 5        & 2    & 2          \\
    Germany                  & 11     & 37   & 10       & 7        & 12   & 4          \\
    New Zealand              & 12     & 8    & 4        & 14       & 5    & 23         \\
    France                   & 13     & 36   & 15       & 8        & 7    & 3          \\
    Poland                   & 23     & 44   & 20       & 28       & 4    & 8          \\
    India                    & 32     & 24   & 26       & 32       & 3    & 5          \\
    Mexico                   & 45     & 2    & 56       & 40       & 49   & 40   
    \\
    \hline    
\end{tabular}
\end{minipage}
1
  • The data columns currently are all equally wide already. (Each data column has at least one two-digit integer.) How wide do you want the data columns to be?
    – Mico
    Nov 25, 2016 at 13:10

1 Answer 1

0

Like this?

enter image description here

\documentclass{article}
\usepackage{siunitx}
\usepackage{caption}

\begin{document}

\begin{minipage}{\linewidth}
\centering
\renewcommand\arraystretch{1.2}
\captionof{table}{label}
\label{table}
\begin{tabular}{|l|*{6}{S[table-format=3.1]|}}
    \hline
    Name                     & 1      & 2    & 3    & 4     & 5     & 6 \\ \hline
    USA                      & 1      & 1    & 1        & 2        & 22   & 6          \\
    Italy                    & 2      & 6    & 6        & 4        & 11   & 10         \\
    UK                       & 3      & 30   & 3        & 1        & 9    & 9          \\
    Canada                   & 4      & 10   & 7        & 12       & 74   & 37         \\
    Spain                    & 5      & 3    & 2        & 3        & 1    & 1          \\
    Switzerland              & 6      & 5    & 5        & 6        & 35   & 44         \\
    Netherlands              & 7      & 4    & 8        & 11       & 17   & 14         \\
    Romania                  & 10     & 14   & 17       & 5        & 2    & 2          \\
    Germany                  & 11     & 37   & 10       & 7        & 12   & 4          \\
    New Zealand              & 12     & 8    & 4        & 14       & 5    & 23         \\
    France                   & 13     & 36   & 15       & 8        & 7    & 3          \\
    Poland                   & 23     & 44   & 20       & 28       & 4    & 8          \\
    India                    & 32     & 24   & 26       & 32       & 3    & 5          \\
    Mexico                   & 45     & 2    & 56       & 40       & 49   & 40
    \\
    \hline
\end{tabular}
\end{minipage}

\end{document}
2
  • Yes, like this! But what if the first row are words and not numbers? Name & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline
    – Anna
    Nov 25, 2016 at 15:25
  • words had to enclosed with curly braces like `Name & {word 1} & {word 2} & {word 3} & {word 4} & {word 5} & {word 6} \`
    – Zarko
    Nov 25, 2016 at 18:30

You must log in to answer this question.

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