특정 열의 열 너비를 확장하는 방법은 무엇입니까?

특정 열의 열 너비를 확장하는 방법은 무엇입니까?

테이블의 특정 열의 열 너비를 확장하는 방법은 무엇입니까? 시도했지만 \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\captioncenter\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}

관련 정보