표의 행과 열 너비를 조정하려면 어떻게 해야 합니까?
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{mathtools}
\begin{document}
\begin{table}[]
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{}cccllll@{}}
\toprule
No & TYPE & \multicolumn{2}{c}{X} & \multicolumn{1}{c}{Y} & \multicolumn{1}{c}{Z} & \multicolumn{1}{c}{T} \\ \midrule
\multirow{2}{*}{1} & A & \multicolumn{2}{c}{\multirow{2}{*}{$\begin{aligned}
M &= -\frac{1}{D} \\
d &= e+f
\end{aligned}$}} & 4th column & 5th column & 6th column \\ \cmidrule(lr){2-2} \cmidrule(l){5-7}
& B & \multicolumn{2}{c}{} & & & \\ \midrule
\multirow{2}{*}{2} & C & \multicolumn{2}{c}{\multirow{2}{*}{}} & & & \\ \cmidrule(lr){2-2} \cmidrule(l){5-7}
& D & \multicolumn{2}{c}{} & & & \\ \bottomrule
\end{tabular}%
}
\end{table}
\end{document}
답변1
테이블을 확장하지 마십시오. 저널의 요구 사항에 맞게 글꼴 크기를 유지하세요.
\documentclass{IEEEtran}
\usepackage{tabularray}
\usepackage{lipsum}
\begin{document}
\begin{table*}
\caption{title}
\begin{tblr}
{
colspec = {Q[c,m]Q[c,m]Q[c,m]X[c,m]X[c,m]X[c,m]},
hline{1,Z} = {wd=.08em},
hline{2,4} = {wd=.05em},
hline{3,5} = {2}{wd=.05em},
hline{3,5} = {4-Z}{wd=.05em},
cell{2,4}{1} = {r=2}{},
}
No & TYPE & X & Y & Z & T \\
1 & A & $M=-\frac{1}{D}$ & 4th column & 5th column & 6th column \\
& B & $d=e+f$ & & & \\
2 & C & & & & \\
& D & & & & \\
\end{tblr}
\end{table*}
\lipsum
\begin{table}
\caption{title}
\begin{tblr}
{
colspec = {Q[c,m]Q[c,m]Q[c,m]X[c,m]X[c,m]X[c,m]},
hline{1,Z} = {wd=.08em},
hline{2,4} = {wd=.05em},
hline{3,5} = {2}{wd=.05em},
hline{3,5} = {4-Z}{wd=.05em},
cell{2,4}{1} = {r=2}{},
}
No & TYPE & X & Y & Z & T \\
1 & A & $M=-\frac{1}{D}$ & 4th column & 5th column & 6th column \\
& B & $d=e+f$ & & & \\
2 & C & & & & \\
& D & & & & \\
\end{tblr}
\end{table}
\begin{table}
\caption{title}
\begin{tblr}
{
colspec = {Q[c,m]Q[c,m]Q[c,m]X[c,m]X[c,m]X[c,m]},
hline{1,Z} = {wd=.08em},
hline{2,4} = {wd=.05em},
hline{3,5} = {2}{wd=.05em},
hline{3,5} = {4-Z}{wd=.05em},
cell{2,4}{1} = {r=2}{},
columns = {colsep=3pt},
}
No & TYPE & X & Y & Z & T \\
1 & A & $M=-\frac{1}{D}$ & 4th column & 5th column & 6th column \\
& B & $d=e+f$ & & & \\
2 & C & & & & \\
& D & & & & \\
\end{tblr}
\end{table}
\lipsum
\end{document}
답변2
이와 같이?
- 셀을 사용하는 이유는 명확하지 않습니다
\multicolumn
. - 내가 이해했듯이 첫 번째와 세 번째 열에는 여러 행 셀이 있습니다.
- 간단
tabularray
합니다.
\documentclass[journal]{IEEEtran}
\usepackage{lipsum}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs}
\usepackage{mathtools}
\begin{document}
\lipsum[11]
\begin{table}[ht]
\begin{tblr}{colspec = {@{} Q[c, m] c Q[c,mode=math] *{3}{X[l]} @{}},
cell{even[2]}{1-3} = {r=2}{}, % multi row cell{<rows>}{<columns>}
rowsep=3pt,
vspan = even
}
\toprule
No & TYPE & X & Y & Z & T \\
\midrule
1 & A & \begin{aligned}
M & = -\frac{1}{D} \\
d & = e + f
\end{aligned}
& 4th column
& 5th column
& 6th column \\
\midrule
& B & & & \\
\midrule
2 & C & & & \\
\midrule
& D & & & \\
\bottomrule
\end{tblr}
\end{table}
\end{document}