1

I am trying to have a table in latex that spans two-column in my thesis paper. Actually, I want to have the following table:

enter image description here

Essentially I have come up with the following table:

enter image description here

The code table is as follows:

\begin{table*}
\begin{tabularx}{\textwidth}{ 
| >{\centering\arraybackslash}p{1cm} |   X | p{0.5cm} | 
  >{\centering\arraybackslash}X |   p{0.5cm}  | 
  > {\centering\arraybackslash}X |   p{0.5cm} | 
}
  \hline
  \textbf{Code}
  & \multicolumn{2}{c|}{\textbf{Richtige Bewertung}}
%  & \multicolumn{2}{c}{ \multirow{2}{}{\textbf{Richtige Bewertung}}}
  & \multicolumn{4}{c|}{\textbf{Falsche Bewertung}} \\ 
  \cline{4-7}
  & \multicolumn{2}{c|}{}
  & \multicolumn{2}{c|}{\textbf{False Negatives}} 
  & \multicolumn{2}{c|}{\textbf{False Positives}} \\ 
  \hline  %% in your example was only one line!
$\mathbf{A_1}$ & \StrokeFive\StrokeFive\StrokeTwo (12) & & & & & \\ \hline
$\mathbf{A_2}$ & & & & & & \\ \hline
$\mathbf{B_1}$ & & & & & & \\ \hline
$\mathbf{B_2}$ & & & & & & \\ \hline
$\mathbf{C_1}$ & & & & & & \\ \hline
$\mathbf{C_2}$ & & & & & & \\ \hline
$\mathbf{D_1}$ & & & & & & \\ \hline
$\mathbf{D_2}$ & & & & & & \\ \hline
\end{tabularx}
\end{table*}

How can I get the my desired table in latex?

1

The following MWE replicate table as it is shown in the first image in your question:

enter image description here

\documentclass[twocolumn]{article}
\usepackage{makecell, multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
    \begin{table*}
    \setcellgapes{3pt}
    \makegapedcells
\begin{tabularx}{\textwidth}{ | *{6}{C|} }
  \hline
\multirow{2.5}{=}{ - - - - }
    &   \multirow{2.5}{=}{ - - - - }
        &   \multicolumn{2}{c|}{ - - - - } 
            &   \multicolumn{2}{c|}{ - - - - }      \\
    \cline{3-6}
    &   & - - - -  & - - - - & - - - - & - - - -    \\ 
    \hline
    &   & - - - -  & - - - - & - - - - & - - - -    \\
    \hline
    &   & - - - -  & - - - - & - - - - & - - - -    \\
    \hline
\end{tabularx}
    \end{table*}
\end{document}

The second image show different table and can be reproduced by your code. So, it is not clear, what you are after.

1
  • Thank you. Your answer fits to my question. – A Stranger Mar 1 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.