I tried using multiple tabularx environments inside a table environment, but this leads to issues with the entire text being aligned towards the left and not matching with the column headings, which in this example below are V1, V2, V3:
I'm getting the error for the following code (I tried removing \hline but that doesn't help):
Misplaced \noalign.: You have used a \hline command in the wrong place, probably outside a table. If the \hline command is written inside a table, try including \\ before it.
\begin{table}[]
\begin{tabular*}{\textwidth}{SSSS} \hline
{$ $} & {$metric$} & {$metric$} & {$metric$} \\ \hline
\textbf{class 1} & 0 & 0 & 0 \\
\midrule
\textbf{HEADING}
\midrule
\textbf{model (1)} & 0 & 0 & 0\\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\midrule
\textbf{model (1)} & 0 & 0 & 0\\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\midrule
\textbf{HEADING}
\midrule
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\midrule
\textbf{model (1)} & 0 & 0 & 0\\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\textbf{model (1)} & 0 & 0 & 0 \\
\bottomrule
\end{tabular*}
\caption{caption here}
\label{table:results}
\end{table}





\centering\arraybackslash– David Carlisle Feb 17 '21 at 00:18tabular*but atabular*will not expand unless you use\extracolsep. The error you show is unrelated and simply that you have forgotten the\\after\textbf{HEADING}– David Carlisle Feb 17 '21 at 00:47