0

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

How Do I create this table?!

1
  • 3
    Welcome to TeX.SX! There's a way, best using booktabs and a tabular. What have you tried so far (please show a MWE).
    – TeXnician
    Sep 23, 2017 at 7:13

2 Answers 2

1

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.

0

Slightly different approach

enter image description here

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table}[!htpb]
\centering
\begin{tabular}{@{}ccccccc@{}}
\toprule
\multicolumn{3}{c}{B}  &  & \multicolumn{3}{c}{A}  \\ \cline{1-3}\cline{5-7}\\[-1em]
$B_3$  & $B_2$ & $B_1$ &  & $A_3$ & $A_2$ & $A_1$  \\
       &       &       &  &       &       &        \\
\multicolumn{3}{c}{NB} &  & \multicolumn{3}{c}{NA} \\ \bottomrule
\end{tabular}
\end{table}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .