Como posso ajustar as larguras das linhas e colunas da tabela?
\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}
Responder1
Não escale a mesa. Mantenha o tamanho da fonte de acordo com os requisitos da revista.
\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}
Responder2
Assim?
- Não está claro por que você usa
\multicolumn
células. - Pelo que entendi, na primeira e na terceira colunas você tem células com várias linhas
- Com
tabularray
é simples:
\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}