[Tex/LaTex] Subdividing a column in a tabular

columnstables

I recently had to make a table that came out more or less like this:

\begin{tabular}{|l|l|l|}
\hline
Head 1 & Head 2\\
\hline
1 & \multicolumn{2}{|c|}{A}\\ \hline
2 & \multicolumn{2}{|c|}{B}\\ \hline
3 & \multicolumn{2}{|c|}{C}\\ \hline
4 & Da & Db \\ \hline
5 & \multicolumn{2}{|c|}{E}\\ \hline
6 & \multicolumn{2}{|c|}{F}\\ \hline
\end{tabular}

I was wondering whether it is possible to specify that the row starting with 4 has its second column subdivided instead of specifying that all the other rows have a cell that spans multiple columns.

Best Answer

Use a nested tabular:

\begin{tabular}{|l|c|}
\hline
Head 1 & Head 2\\
\hline
1 & A\\ \hline
2 & B\\ \hline
3 & C\\ \hline
4 & \begin{tabular}{@{}c|c@{}}Da & Db\end{tabular} \\ \hline
5 & E\\ \hline
6 & F\\ \hline
\end{tabular}

However you should consider avoiding vertical rules in your table; consult the documentation of the booktabs package.