
如何擴大表格中特定列的列寬?我嘗試過\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
由於 ac 列從最寬的成員獲取其寬度,因此您所需要做的就是強制任何成員的寬度為給定寬度。 \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}