指定列宽

指定列宽

我有下表。我需要让除第一列之外的所有列都具有相同的宽度。你能帮我吗?

\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

像这样?

在此处输入图片描述

\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}

相关内容