テキスト幅の表

テキスト幅の表

テーブルをテキスト幅に合わせたい場合は、次のコードを使用します。

\begin{table}[t]  
                \small
                \caption{Summary descriptive statistics}
                \label{tab1:summary_by_affiliation}
                \centering{\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} c}
\toprule

\multicolumn{1}{c}{Test 1} & \multicolumn{1}{c}{Test 2}  \\
\midrule
Mean & 6.37  \\
Median & 1.00  \\
Std. Dev. & 19.01  \\
Kurtosis & 39.33  \\
Skewness & 5.79  \\
Minimum & 0.09  \\
Maximum & 194.45  \\
Sum & 5845 \\
Count & 917  \\
\bottomrule
\end{tabular*}}

\vspace{-2ex}
\begin{tablenotes}[flushleft]
\footnotesize
\singlespacing
\item\hspace{-2.5pt}\textit{Note}: Test
\end{tablenotes}
\end{table}

結果は次のようになります。

ここに画像の説明を入力してください

しかし、私が実際に欲しいのはこれです(縦棒などはありませんが、配置は次のようになります)。

ここに画像の説明を入力してください

答え1

tabular*環境から 環境に切り替えて、列タイプではなく列タイプtabularxの中央揃えバージョンを使用することで、書式設定の目的を達成できます。Xc

環境は必要ないと思われますtablenotes

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{tabularx,booktabs}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
\begin{table}[t]
%\small
\caption{Summary descriptive statistics}
\label{tab1:summary_by_affiliation}

\begin{tabularx}{\textwidth}{CC}
\toprule
Test 1 & Test 2  \\
\midrule
Mean & 6.37  \\
Median & 1.00  \\
Std. Dev. & 19.01  \\
Kurtosis & 39.33  \\
Skewness & 5.79  \\
Minimum & 0.09  \\
Maximum & 194.45  \\
Sum & 5845 \\
Count & 917  \\
\bottomrule
\end{tabularx}

\medskip 
\footnotesize
\textit{Note}: Test
\end{table}
\end{document} 

関連情報