[Tex/LaTex] Table with 2 columns and 3 subcolumns

multicolumntables

I want to create the table as is shown in the following picture.
Could you please help me?

How Do I create this table?!

Best Answer

This is one way to do it:

\documentclass{article}

\usepackage{booktabs}
\usepackage[tableposition=top]{caption} % Spaces the caption properly

\begin{document}

\begin{table}[htb]
  \centering
  \caption{Caption}
  \label{tab:example}
  \begin{tabular}{*6c}
    \toprule
    \multicolumn{3}{c}{B}  & \multicolumn{3}{c}{A}  \\ \cmidrule(r){1-3} \cmidrule(l){4-6}
    B3 & B2 & B1           & A3 & A2 & A1           \\
                                                    \\ \cmidrule(r){1-3} \cmidrule(l){4-6}
    \multicolumn{3}{c}{NB} & \multicolumn{3}{c}{NA} \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

enter image description here

I suggest you to look up on the LaTeX Wikibook when you need some general information. For any particular package you use, always read its documentation on the CTAN. A very handy general reference is Stefan Kottwitz's LaTeX Cookbook. It's not gratis, however, Packt often make some deals, so keep an eye on their site if you wish.

Related Question