[Tex/LaTex] How to divide a table row into several columns

columnstables

I have a table with two columns. In the first column there is no multiple column. But there are 11 multiple columns in the second column. The format looks like:

 | A |                     B                       |
 | _ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

A and B are headings, and 1, 2, 3, …, 11 are subheadings of the table. After that there are some rows containing data.

I have tried several ways but cannot do it.

Best Answer

What you need is the \multicolumn macro:

\documentclass{article}
\begin{document}
\begin{tabular}{|l|*{11}{c|}}
  \hline
   A & \multicolumn{11}{|c|}{B} \\ \hline
   \_ & 1&2&3&4&5&6&7&8&9&10&11 \\ \hline
\end{tabular}
\end{document}

output

Related Question