[英]Latex table too wide
下面的代碼顯示了我的表格,但它顯然太寬了。 我不熟悉 tabularx 或 tabular* 這樣的包,所以我真的不確定如何調整表格以使其正確適合我的頁面。 我也不介意桌子側向或處於橫向模式,但是當我嘗試桌子定位時,它的位置已經偏離了。 有人可以幫幫我嗎?
\begin{table}
\begin{threeparttable}
\centering
\caption[Descriptive Statistics ]{Descriptive Statistics s}
\sisetup{add-integer-zero=false}
\begin{tabular}{lcccccccccccccccccccc}
\toprule
& \multicolumn{6}{c}{$\boldsymbol{2004-2011}$} && \multicolumn{6}{c}{$\boldsymbol{2012-2020}$} && \multicolumn{6}{c}{\textbf{Full Sample}}\\
\cmidrule(r){2-7}\cmidrule(lr){9-14}\cmidrule(l){16-21}
\\
& \textbf{Mean} & \textbf{Std.Dev.} &\textbf{Median} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs} && \textbf{Mean} & \textbf{Std.Dev.} &\textbf{Median} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs}&& \textbf{Mean} & \textbf{Std.Dev.} &\textbf{Median} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs} \\
\midrule
\textbf{FSTS} & 0.39& 0.24& 0.38& -0.37&1.0& 3,039&& 0.42&0.24&0.40&-0.06&1.0&4,566& &0.40 & 0.24& 0.39& -0.37& 1.0&7,605 \\\addlinespace
\textbf{FATA} &0.33 &0.25 &0.30 &-2.15 &0.99 & 3,039&& 0.35&0.26&0.31&-1.53&1.0&4,566 && 0.34&0.25 &0.31 &-2.15 & 1.0&7,605 \\\addlinespace
\textbf{OSTS} &0.33 &0.34 &0.20 &0.0 &1.0 &3,039& &0.45 &0.34 & 0.55& 0.0&1.0 & 4,566&& 0.40&0.34 &0.46 &0.0 & 1.0&7,605 \\\addlinespace
\textbf{PDIO} &3.63 &3.19 & 2.0&1.0 &10.0& 3,039&& 4.79& 3.38& 4.0& 1.0& 10& 4,566&& 4.32 & 3.35& 3.0& 1.0& 10.0& 7,605 \\\addlinespace
\textbf{DOI} & 0.51&0.21& 0.43& 0.0& 0.99& 3,039& &0.59& 0.21& 0.62& 0.26& 1.0& 4,566&& 0.56& 0.21& 0.57& 0.0& 1.0& 7,605 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item \footnotesize\textit{Note.} $N=330$ in $t_1$; $N=328$ in $t_2$; $N=298$ in $t_3$. $\alpha$ represents Cronbach's Alpha. Prompt pursuit is presented as a global scale.
\end{tablenotes}
\label{tab:scales}%
\end{threeparttable}
\end{table}
您可以使用sidewaystable
環境使用 package rotating
來旋轉桌子。 我打破了Std.Dev這個詞。 通過我的宏\spheadcenter
\newcommand{\spheadcenter}[2][0]{%
{{\begin{turn}{#1}\let\toprule\relax\begin{tabular}[t]{c} #2 \end{tabular}\end{turn}}}}
通過\tabcolsep3pt
調整列空間。 @{}
是去掉表格左右多余的空格。 見我下面的編碼
\begin{sidewaystable}[!p]
\begin{threeparttable}
\centering
\caption[Descriptive Statistics ]{Descriptive Statistics s}
\sisetup{add-integer-zero=false}
{\tabcolsep3pt\begin{tabular}{@{}lcccccccccccccccccccc@{}}
\toprule
& \multicolumn{6}{c}{$\boldsymbol{2004-2011}$} && \multicolumn{6}{c}{$\boldsymbol{2012-2020}$} && \multicolumn{6}{c}{\textbf{Full Sample}}\\
\cmidrule(r){2-7}\cmidrule(lr){9-14}\cmidrule(l){16-21}
\\
& \textbf{Mean} & \textbf{\spheadcenter{Std.\\Dev.}} &\textbf{Median} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs} && \textbf{Mean} & \textbf{\spheadcenter{Std.\\Dev.}} &\textbf{Median} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs}&& \textbf{Mean} & \textbf{\spheadcenter{Std.\\Dev.}} &\textbf{Median} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs} \\
\midrule
\textbf{FSTS} & 0.39& 0.24& 0.38& -0.37&1.0& 3,039&& 0.42&0.24&0.40&-0.06&1.0&4,566& &0.40 & 0.24& 0.39& -0.37& 1.0&7,605 \\\addlinespace
\textbf{FATA} &0.33 &0.25 &0.30 &-2.15 &0.99 & 3,039&& 0.35&0.26&0.31&-1.53&1.0&4,566 && 0.34&0.25 &0.31 &-2.15 & 1.0&7,605 \\\addlinespace
\textbf{OSTS} &0.33 &0.34 &0.20 &0.0 &1.0 &3,039& &0.45 &0.34 & 0.55& 0.0&1.0 & 4,566&& 0.40&0.34 &0.46 &0.0 & 1.0&7,605 \\\addlinespace
\textbf{PDIO} &3.63 &3.19 & 2.0&1.0 &10.0& 3,039&& 4.79& 3.38& 4.0& 1.0& 10& 4,566&& 4.32 & 3.35& 3.0& 1.0& 10.0& 7,605 \\\addlinespace
\textbf{DOI} & 0.51&0.21& 0.43& 0.0& 0.99& 3,039& &0.59& 0.21& 0.62& 0.26& 1.0& 4,566&& 0.56& 0.21& 0.57& 0.0& 1.0& 7,605 \\
\bottomrule
\end{tabular}}
\begin{tablenotes}
\item \footnotesize\textit{Note.} $N=330$ in $t_1$; $N=328$ in $t_2$; $N=298$ in $t_3$. $\alpha$ represents Cronbach's Alpha. Prompt pursuit is presented as a global scale.
\end{tablenotes}
\label{tab:scales}%
\end{threeparttable}
\end{sidewaystable}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.