I am struggling trying to have the four column under the multicolumn of same width and centered. This is the code:
\begin{table*}[ht]
\centering
\begin{tabular}{c|cccc|cc}
\toprule
\multirow{2}{*}{Model} & \multicolumn{4}{c|}{Percentage of predictions with error value} & \multirow{2}{*}{$\mu$} & \multirow{2}{*}{$\sigma$} \\
& $<10\%$ & $<5\%$ & $<2\%$ & $<1\%$\\
\midrule
Omega-Csi & 100 & 99.95 & 98.52 & 95.77 & -0.034 & 0.48\\
9-Input, grid training & 99.95 & 99.53 & 96.25 & 89.13 & 0.016 & 0.92\\
9-Input, random training & 100 & 99.94 & 99.51 & 97.98 & -0.031 & 0.36\\
\bottomrule
\end{tabular}
\caption{Percentage error characteristics of different model predictions on internal test sets}
\label{tab:2}
\end{table*}
that generates this table:
\setlength\tabcolsep{width} doesn't work as it modifies the width of all columns and makes the table exceed the textwidth before equalizing the spaces.
I would like to have all the column with the <% values of same width and occupying exactly the space under the \multicolumn header.
Best Answer
\multicolumn
cell should be greater than width of\multicolumn
content. if it is not, than last spanned column is widened accordinglytabularray
package (version 2022B) with optionhspan=even
which take a care that spanned columns have equal widths (second table below)S
columns defined insiunitx
packages (in example loaded astabularray
library) which enable align numbers at decimal points and use math ˙-˙symbol:Note: Since in code fragment you use
table*
float environment, I assume that document is of two columns.Edit: ups, forgot to add image of tables :-(. Now is presented: