How can I ensure that the table fits the width of the page automatically? I assumed that the specification would take care of it, but it seems not to be the case. Unfortunately, I cannot include actual images to illustrate the problem, so I have used dummy images with enlarged sizes to demonstrate the issue.
In addition, I tried to ensure that the two images in the "Normalized coefficient" row would be of the same size by setting two columns as X[c]. However, it seems that this approach did not work as expected. Below is the MWE of the issue.
\documentclass[journal]{IEEEtran}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tabularray}
\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{subfig}
\begin{document}
\lipsum[]
\adjustboxset{width=\linewidth, valign=M}
\onecolumn
\begin{longtblr}{
width=\textwidth,
cells = {c},
hlines,
colspec= {|c| X[c,m]}
}
1 & X \\
2 & y \\
3 &\begin{tblr}{
width=\linewidth,
colspec={c X[c] X[c]},
cells={},
hlines,
hline{Z}={3pt,blue5},
row{1-Z}={font=\small},
}
C1 & C2 & C3\\
{Normalized \\Coefficient} & \adjincludegraphics{example-image-a} & \adjincludegraphics{example-image-b} \\
$A$ & \SetCell[c=2]{c} \adjincludegraphics{example-image-a} \\
$B$ & \SetCell[c=2]{c} \adjincludegraphics{example-image-a} \\
\end{tblr} \\
\end{longtblr}
\end{document}
Best Answer
hspan=minimal
you can fix width of images, but the same time image in multicolumn cells get spurious vertical space )wjic not arrise if these cells contain a text:It seems that this is caused with some bug, so we need a help of package author.
Addendum: What to do meanwhile?
Not use
\tabularray
package and rather stick with good oldtabularx
package: