I need a table with this format:
I need to use tabularx. I already tried something but it doesn't work… I keep getting the error message '! Missing number, treated as zero.'
\documentclass{scrartcl}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\textwidth}{ >{\centering\arraybackslash}p{1cm} | X | p{0.5cm} | >{\centering\arraybackslash}X | p{0.5cm} > {\centering\arraybackslash}X | p{0.5cm} }
\multirow{2}{*}{\textbf{Code}} & \multicolumn{2}{c}{\multirow{2}{}{\textbf{Richtige Bewertung}}} & \multicolumn{4}{c}{\textbf{Falsche Bewertung}} \\ \cline{4-7}
& & \multicolumn{2}{c}{\textbf{False Negatives}} & \multicolumn{2}{c}{\textbf{False Positives}} \\ \hline\hline
$\boldsymbol{A_1}$ & \StrokeFive\StrokeFive\StrokeTwo (12) & & & & & \\ \hline
$\boldsymbol{A_2}$ & & & & & & \\ \hline
$\boldsymbol{B_1}$ & & & & & & \\ \hline
$\boldsymbol{B_2}$ & & & & & & \\ \hline
$\boldsymbol{C_1}$ & & & & & & \\ \hline
$\boldsymbol{C_2}$ & & & & & & \\ \hline
$\boldsymbol{D_1}$ & & & & & & \\ \hline
$\boldsymbol{D_2}$ & & & & & & \\
\end{tabularx}
\end{document}
Can anyone help me with this?
Thank you very much in advance.
Daniel
Best Answer
You have forgotten a lot of vertical bars
|
in the declaration of your table.Also, you must remember, that if you use
\multicolumn
, you are redefining the look of the column, including the vertical bars. You have to repeat the definition of vertical bars in that case.Next, you were missing some important packages, for example
multirow
, to get the\multirow
-command working. Packageifsym
with option[misc]
to make the command\StrokeFive
working.You should think about using the
>{$}...<{$}
magic, to save from repeatedly inserting the$
in the first column.I was not able to find a package for the command
\boldsymbol
. I replaced it by\mathbf
which might be the same.First example:
Second example, using
>{$}...<{$}
to save typing:Result for both examples: