![テキスト幅の表](https://rvso.com/image/399820/%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E5%B9%85%E3%81%AE%E8%A1%A8.png)
テーブルをテキスト幅に合わせたい場合は、次のコードを使用します。
\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
の中央揃えバージョンを使用することで、書式設定の目的を達成できます。X
c
環境は必要ないと思われます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}