0

I need help for drawing such a table in latex

enter image description here

4

below is a barebones solution and a nicer solution. To make it look prettier, you might want to look at packages like multirow and booktabs, and tabularx. You can find some tips for making nice tables here.

Your Table

\documentclass[landscape, 10pt]{article}
\begin{document}
\begin{table}
\caption{Your table}
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|}
    \hline
    Method  &   CP  & \multicolumn{3}{c|}{Parameters}   & \multicolumn{3}{c|}{Standard Error} & \multicolumn{3}{c|}{P-values} ``\\``
    \hline
            &       & $\omega$ & $\alpha$ & $\beta$ & $\omega$ & $\alpha$ & $\beta$ & $\omega$ & $\alpha$ & $\beta$ ``\\``
    \hline
    BAE     &       & 7.1$e$-3 & 6.3$e$-1 & 1.4$e$-1    & 2.2$e$-4 & 2.2$e$-2 & 5.1$e$-2    & 4.2$e$-3 & 1.0$e$-1 & 6.8$e$-3 ``\\``
    QML     &   A   & 7.1$e$-3 & 7.1$e$-1 & 1.0$e$-8    & 1.9$e$-3 & 1.1$e$-1 & 1.1$e$-1    & 2.2$e$-4 & 8.8$e$-11 & 1.0$e$0 ``\\`` 
    SVM     &       & 7.0$e$-3 & 6.5$e$-1 & 1.4$e$-1    & 2.0$e$-4 & 4.5$e$-2 & 4.9$e$-2    & 4.0$e$-3 & 0.9$e$-1 & 6.0$e$-4 ``\\``
    \hline
    BAE     &       & 8.9$e$-3 & 5.4$e$-1 & 2.6$e$-1    & 7.0$e$-4 & 4.0$e$-2 & 4.0$e$-2    & 3.3$e$-3 & 1.0$e$-1 & 4.0$e$-3 ``\\``
    QML     &   B   & 7.4$e$-3 & 5.1$e$-1 & 4.1$e$-1    & 5.5$e$-3 & 1.4$e$-1 & 2.9$e$-1    & 4.3$e$-1 & 5.3$e$-4 & 1.6$e$-1 ``\\``
    SVM     &       & 6.5$e$-3 & 5.2$e$-1 & 3.0$e$-1    & 5.0$e$-4 & 3.8$e$-2 & 3.5$e$-2    & 2.9$e$-3 & 4.5$e$-5 & 2.4$e$-4 ``\\``
    \hline
\end{tabular}
\end{table}
\end{document}

Nice Table

\documentclass[landscape, 10pt]{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage[justification=raggedright,labelfont=bf]{caption}
\begin{document}
\begin{table}
\caption{Nicer table}
\begin{tabular}{@{}lc*{3}{r@{$e$}l}c*{3}{r@{$e$}l}c*{3}{r@{$e$}l}@{}}
    \toprule
    \multirow{2}{*}{Method} &   \multirow{2}{*}{CP} & \multicolumn{6}{c}{Parameters}    && \multicolumn{6}{c}{Standard Error} && \multicolumn{6}{c}{P-values} ``\\``
                        \cmidrule{3-8}                  \cmidrule{10-15}                    \cmidrule{17-22}
            &       & \multicolumn{2}{c}{$\omega$} & \multicolumn{2}{c}{$\alpha$} & \multicolumn{2}{c}{$\beta$} && \multicolumn{2}{c}{$\omega$} & \multicolumn{2}{c}{$\alpha$} & \multicolumn{2}{c}{$\beta$}    && \multicolumn{2}{c}{$\omega$} & \multicolumn{2}{c}{$\alpha$} & \multicolumn{2}{c}{$\beta$} ``\\``
    \midrule
    BAE     &\multirow{3}{*}{A} & 7.1&-3 & 6.3&-1 & 1.4&-1  && 2.2&-4 & 2.2&-2 & 5.1&-2 && 4.2&-3 & 1.0&-1 & 6.8&-3 ``\\``
    QML     &       & 7.1&-3 & 7.1&-1 & 1.0&-8  && 1.9&-3 & 1.1&-1 & 1.1&-1 && 2.2&-4 & 8.8&-11 & 1.0&0 ``\\``
    SVM     &       & 7.0&-3 & 6.5&-1 & 1.4&-1  && 2.0&-4 & 4.5&-2 & 4.9&-2 && 4.0&-3 & 0.9&-1 & 6.0&-4 ``\\``
    \midrule
    BAE     &\multirow{3}{*}{B} & 8.9&-3 & 5.4&-1 & 2.6&-1  && 7.0&-4 & 4.0&-2 & 4.0&-2 && 3.3&-3 & 1.0&-1 & 4.0&-3 ``\\``
    QML     &       & 7.4&-3 & 5.1&-1 & 4.1&-1  && 5.5&-3 & 1.4&-1 & 2.9&-1 && 4.3&-1 & 5.3&-4 & 1.6&-1 ``\\``
    SVM     &       & 6.5&-3 & 5.2&-1 & 3.0&-1  && 5.0&-4 & 3.8&-2 & 3.5&-2 && 2.9&-3 & 4.5&-5 & 2.4&-4 ``\\``
    \bottomrule
\end{tabular}
\end{table}
\end{document}

This is how the two tables look like

Resulting tables

|improve this answer|||||
  • +1 for adding the typographically pleasing "nice table" variant. – AlexG Jun 12 '19 at 11:02
  • Thank you so much for your help – Kimwaga makono Jun 12 '19 at 13:04
  • What if I would like to interchange the (nice table)'s first and second column, to read as follows: CP Method ........ .......... ....... Thanks – Kimwaga makono Jun 22 '19 at 14:54
  • The columns are delimited by the ampersand symbol (&). So if you want to switch the 1st and 2nd columns, all you have to do is to put everything that is before the first "&" (that is, the old first column) behind it and everything that used to be between the first and second "&" (old second column) before the first "&", like so: old: \multirow{2}{}{Method} & \multirow{2}{}{CP} & ... new: \multirow{2}{}{CP} & \multirow{2}{}{Method} & ... – Frederic Schneider Jun 25 '19 at 10:53

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.