# Table with two kinds of rows [closed]

How would I go about making a table that looks like this :

A-------
A1-------
A2-------
B-------
B1-------
B2-------

Where rows A and B have the same columns, A1, A2, B1, B2 have all the same columns, but different from those of A and B.

Finding a common subdivision of columns of the two kinds of rows would be a nightmare.

EDIT : Here's a picture of what I have in mind :

## closed as unclear what you're asking by Zarko, Werner, Jesse, Stefan Pinnow, user31729 Jul 26 '16 at 6:08

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Welcome to TeX.SX! You question is unclear, but you may be looking for \multicolumn! – user31729 Jul 20 '16 at 10:57
• My understanding of \multicolumn is that you make a cell span several columns. This works well if say the set of columns of rows of type A1 is a subset of the set of columns of rows of type A. That's what I refer to when I talk about a common subdivision of columns. – JadeSnail Jul 20 '16 at 11:01
• Can you give us an image of what you want? Perhaps created in Excel or a drawing program? – James Jul 20 '16 at 11:04
• @JadeSnail: Well, as I said, your question is unclear – user31729 Jul 20 '16 at 11:05
• @JadeSnail, with multicolumn you can also change coulmn type in selected cell, for example: \multicolumn{1}{c}{...} for centering content of this cell ... And as Christian Hupfer said, your question is unclear. Try to provide a table in which wrote in cell, what should formatting differ from other cell. – Zarko Jul 20 '16 at 11:13

Here an example of a solution based on tabularx:

\documentclass{article}
\usepackage{array,  booktabs, tabularx, caption}
\usepackage[table,  svgnames]{xcolor}

\begin{document}

\begin{table}
\centering\captionsetup{labelfont=sc, skip=6pt}
\caption{A table}
\begin{tabularx}{0.67\linewidth}{|*{3}{>{\centering\arraybackslash}X|}}
\hline
\rowcolor{Lavender!60}A & B & C \\%
\hline
\end{tabularx}\\[-1.1pt]
\rowcolors{1}{Yellow!10}{Yellow!10}
\begin{tabularx}{0.67\linewidth}{|*{5}{>{\centering\arraybackslash}X|}}
a & b & c & d & e \\
\hline
s & t & u & v & w \\
\hline
\end{tabularx}\\[-1.1pt]%
\begin{tabularx}{0.67\linewidth}{|*{3}{>{\centering\arraybackslash}X|}}
\rowcolor{Lavender!60} A & B & C \\
\hline
\end{tabularx}\\[-1.1pt]
\begin{tabularx}{0.67\linewidth}{|*{5}{>{\centering\arraybackslash}X|}}
a & b & c & d & e \\
\hline
s & t & u & v & w \\
\hline
\end{tabularx}
\end{table}

\end{document}