如何扩大特定列的列宽?

如何扩大特定列的列宽?

如何扩展表格中特定列的列宽?我试过了,\begin{tabular}{llc{2cm}c{2cm}cc}但没有用。这是我的代码。

\begin{table}
\begin{center}
\label{table:quantitativekth}
\begin{tabular}{llc{2cm}c{2cm}cc}
\hline\noalign{\smallskip}
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c}{$\text{x}_{0:10} \rightarrow \hat{\text{x}}_{10:30}$}\ \ \ &\multicolumn{2}{c}{$\text{x}_{0:10} \rightarrow \hat{\text{x}}_{10:50}$}\ \ \ \\
 &  & SSIM & PSNR & SSIM & PSNR \\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Deterministic \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 0.639 & - & - \\ % 2.833082
& PredRNN++ \cite{wang-predrnn} & 0.865 & 0.741 & - & - \\ % 15390160
& E3D-LSTM \cite{wang-e3d} & 0.879 & 0.810 & - & - \\ % 38696497, 41940673
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Stochastic & Variational 2D ConvLSTM \cite{vrnn} & - & - & - & - \\ % 2856122
& Ours & 0.863 & 0.850 & - & - \\ %12853578
\noalign{\smallskip}
\hline
\end{tabular}
\end{center}
\caption{Results on the KTH action dataset when predicting 20 timesteps into the future i.e. $\hat{\text{x}}_{10:30}$ and 40 timesteps into the future o.e. i.e. $\hat{\text{x}}_{10:50}$. The metrics are computed frame-wise. Higher SSIM and PSNR scores indicate better results.}
\end{table}

答案1

W下面是使用包中新列类型的示例代码array。此列类型有两个参数,第一个是内容所需的水平对齐方式,第二个是列宽。除此之外,我还加载了包booktabs并使用了它的\toprule\midrule\bottomrule命令,以避免必须\hline与手动添加的空间相结合。除此之外,我还修复了 的位置\lablel。为确保正确引用,应将其放在 之后。最后,我还用命令\caption替换了环境,以避免在表格周围出现额外的空白。center\centering

在此处输入图片描述

\documentclass{article}
\usepackage{geometry}
\usepackage{array}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{llW{c}{2cm}W{c}{2cm}cc}
\toprule
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c}{$\text{x}_{0:10} \rightarrow \hat{\text{x}}_{10:30}$}\ \ \ &\multicolumn{2}{c}{$\text{x}_{0:10} \rightarrow \hat{\text{x}}_{10:50}$}\ \ \ \\
 &  & SSIM & PSNR & SSIM & PSNR \\
\midrule
Deterministic \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 0.639 & - & - \\ % 2.833082
& PredRNN++ \cite{wang-predrnn} & 0.865 & 0.741 & - & - \\ % 15390160
& E3D-LSTM \cite{wang-e3d} & 0.879 & 0.810 & - & - \\ % 38696497, 41940673
\midrule
Stochastic & Variational 2D ConvLSTM \cite{vrnn} & - & - & - & - \\ % 2856122
& Ours & 0.863 & 0.850 & - & - \\ %12853578
\bottomrule
\end{tabular}
\caption{Results on the KTH action dataset when predicting 20 timesteps into the future i.e. $\hat{\text{x}}_{10:30}$ and 40 timesteps into the future o.e. i.e. $\hat{\text{x}}_{10:50}$. The metrics are computed frame-wise. Higher SSIM and PSNR scores indicate better results.}
\label{table:quantitativekth}
\end{table}

\end{document}

答案2

由于 c 列的宽度来自最宽的成员,因此您只需要强制任何成员的宽度为给定的宽度。\makebox[width][c]{text} 就可以做到这一点。

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}

\begin{tabular}{llcccc}
\hline\noalign{\smallskip}
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c}{$\text{x}_{0:10} \rightarrow \hat{\text{x}}_{10:30}$}\ \ \ &\multicolumn{2}{c}{$\text{x}_{0:10} \rightarrow \hat{\text{x}}_{10:50}$}\ \ \ \\
 &  & \makebox[2cm]{SSIM} & \makebox[2cm]{PSNR} & SSIM & PSNR \\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Deterministic \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 0.639 & - & - \\ % 2.833082
& PredRNN++ \cite{wang-predrnn} & 0.865 & 0.741 & - & - \\ % 15390160
& E3D-LSTM \cite{wang-e3d} & 0.879 & 0.810 & - & - \\ % 38696497, 41940673
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Stochastic & Variational 2D ConvLSTM \cite{vrnn} & - & - & - & - \\ % 2856122
& Ours & 0.863 & 0.850 & - & - \\ %12853578
\noalign{\smallskip}
\hline
\end{tabular}

\end{document}

相关内容