텍스트 너비의 표

텍스트 너비의 표

테이블을 텍스트 너비에 맞추려면 다음 코드를 사용합니다.

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

관련 정보