I have some problem with my table: I want to resize it to \textwidth using \resizebox.
The error-message says: "! Missing } inserted." This is a reproducable minimal example:
\begin{table*}[h!]
\caption{Testtable}
\centering \label{}
\begin{tabular}{@{}lcccc|cccc}
\resizebox{\columnwidth}{!}{%
\\[-1.8ex]\hline \hline \\
[-1.8ex] & \multicolumn{4}{c}{(1y)} & \multicolumn{4}{c}{(3y)} \\ \\
[-1.8ex] & [1] & [2] & [3] & [4] & [1] & [2] & [3] & [4]\\
\hline \\
[-1.8ex] test1 & $-$0.01 & $-$0.03 & 4.50 & $-$3.95 & $-$0.64 & 8.97$^{***}$ & 2.31 & $-$10.22$^{*}$ \\
& (2.85) & (3.82) & (3.54) & (4.70) & (2.96) & (2.79) & (4.98) & (5.60) \\
test2 & 11.08$^{***}$ & $-$6.27 & $-$5.59 & 1.26 & 5.07 & 6.50$^{**}$ & $-$4.30 & $-$6.95 \\
& (3.00) & (3.95) & (3.63) & (4.87) & (3.09) & (2.93) & (5.06) & (5.76) \\
Adjusted R$^{2}$ & 0.46 & 0.43 & 0.37 & 0.52 & 0.43 & 0.41 & 0.35 & 0.50 \\
\hline \\
[-1.8ex]
\end{tabular}
}
\end{table*}
I think it is related to this problem: Missing $ inserted while adding resizebox. What I have tried so far: adding $: and $% and the combination as suggested at the related problem, without really understanding the meaning. It didn't work.
I'm grateful for advice!
Many Thanks!

\resizeboxyour tables. – egreg Mar 20 '22 at 11:07\resizeboxis inside the table body and covers more than a single cell's content. – Skillmon Mar 20 '22 at 11:07\columnwidthif you want a full width float? – egreg Mar 20 '22 at 11:17