我可以让这个表格的列更宽吗?另外,底部的标题可以不包含表 1 吗?

我可以让这个表格的列更宽吗?另外,底部的标题可以不包含表 1 吗?

我可以让这个表格的列更宽吗?另外,底部的标题可以不包含表 1 吗?

  % Table generated by Excel2LaTeX from sheet 'Sheet3'
    \begin{table}[htbp]
      \centering
        \begin{tabular}{llllll}
        \multicolumn{6}{l}{Table 3.1: Summary Statistics} \bigstrut[b]\\
        \hline
               & Mean   & Std.   &        & Mean   & Std. \bigstrut\\
        \hline
        $r$    & 0.61   & 4.24   & ElcEq  & 0.79   & 6.02 \bigstrut[t]\\
        Agric  & 0.58   & 6.32   & Autos  & 0.60   & 6.37 \\
        Food   & 0.66   & 4.14   & Aero   & 0.88   & 6.52 \\
        Beer   & 0.69   & 4.98   & Ships  & 0.65   & 6.71 \\
        \hline
        \end{tabular}%
      \caption{Note: In this Caption I do not want to see the table}
      \label{tab:addlabel}%
    \end{table}%

在此处输入图片描述

答案1

\tabcolsep定义列之间的长度。在下面的示例中,它固定为 2em。您可以根据需要更改此值。

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{table}[htbp]
  \setlength{\tabcolsep}{2em}

  \caption{Summary Statistics}\label{tab:addlabel}

  \begin{center}
    \begin{tabular}{llllll}
      \toprule
      & Mean   & Std.   &        & Mean   & Std.\\
      \midrule
      $r$    & 0.61   & 4.24   & ElcEq  & 0.79   & 6.02 \\
      Agric  & 0.58   & 6.32   & Autos  & 0.60   & 6.37 \\
      Food   & 0.66   & 4.14   & Aero   & 0.88   & 6.52 \\
      Beer   & 0.69   & 4.98   & Ships  & 0.65   & 6.71 \\
      \bottomrule
    \end{tabular}
  \end{center}
\end{table}

\end{document}

答案2

以下有两个示例:

在此处输入图片描述

我不建议人为地使各个表格列比其自然宽度更宽。

\documentclass{article}
\usepackage{array}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{geometry}
\usepackage{threeparttable}
\counterwithin{table}{section}
\begin{document}
\section{A section title}

    \begin{table}[htbp]
      \centering
      \caption{Summary Statistics}
      \label{tab:addlabel}%
        \begin{tabular}{*{6}{Wc{2cm}}}
        \toprule
               & Mean   & Std.   &        & Mean   & Std. \\
        \midrule
        $r$    & 0.61   & 4.24   & ElcEq  & 0.79   & 6.02 \\
        Agric  & 0.58   & 6.32   & Autos  & 0.60   & 6.37 \\
        Food   & 0.66   & 4.14   & Aero   & 0.88   & 6.52 \\
        Beer   & 0.69   & 4.98   & Ships  & 0.65   & 6.71 \\
        \bottomrule
        \end{tabular}%
      \caption*{Note: In this Caption I do not want to see the table}
    \end{table}%


    \begin{table}[htbp]
      \centering
      \captionsetup{singlelinecheck=false}
      \begin{threeparttable}
      \caption{Summary Statistics}
      \label{tab:addlabel}%
        \begin{tabular}{*{2}{lcc}}
        \toprule
               & Mean   & Std.   &        & Mean   & Std. \\
        \midrule
        $r$    & 0.61   & 4.24   & ElcEq  & 0.79   & 6.02 \\
        Agric  & 0.58   & 6.32   & Autos  & 0.60   & 6.37 \\
        Food   & 0.66   & 4.14   & Aero   & 0.88   & 6.52 \\
        Beer   & 0.69   & 4.98   & Ships  & 0.65   & 6.71 \\
        \bottomrule
        \end{tabular}%
%        \end{threeparttable}
        \begin{tablenotes}[flushleft]
        \setlength\labelsep{0pt}
        \item[]Note: In this Caption I do not want to see the table
        \end{tablenotes}
        \end{threeparttable}
    \end{table}%
\end{document}

答案3

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{siunitx}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}

\begin{document}
\lipsum[1]
    \begin{table}[htb]
\setlength\tabcolsep{0pt}
\setcellgapes{3pt}
\makegapedcells
\sisetup{table-format=1.2}
    \centering
   \begin{threeparttable}
\caption{Summary Statistics}
\label{tab:addlabel}    
    \begin{tabular*}{0.8\linewidth}{@{\extracolsep{\fill}}lSSlSS}
      \toprule
        & {Mean} & {Std.} &        & {Mean} & {Std.}    \\
      \midrule
$r$     & 0.61   & 4.24   & ElcEq  & 0.79   & 6.02      \\
Agric   & 0.58   & 6.32   & Autos  & 0.60   & 6.37      \\
Food    & 0.66   & 4.14   & Aero   & 0.88   & 6.52      \\
Beer    & 0.69   & 4.98   & Ships  & 0.65   & 6.71      \\
      \bottomrule
    \end{tabular*}
    \begin{tablenotes}\small
\note{some explanation about table}
    \end{tablenotes}
\end{threeparttable}
    \end{table}
\end{document}

相关内容