# How to get single columns and multicolumns in the same table

I want to make a table which looks like following:

I found a question similar to mine situation How do I create the headings for this multirow multicolum table?. But I am unable to manipulate the code given in the answer to get the desired result. Any help!

Here's a way, without multirow, and makecell instead:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{array, makecell}%

\begin{document}

\noindent\sffamily%
\setcellgapes[t]{3.5pt}\makegapedcells%
\setlength{\tabcolsep}{4pt}%
\hline
TITLE1 & TITLE2 & TITLE3 & TITLE4 & TITLE5 & TITLE6 & TITLE7 & \multicolumn{2}{c|}{\makecell{TITLE8 \\Sub1\quad Sub2}} \\
\hline
A1 & B1 & C1 & D1 & E1 & F1 & G1 & H1 & I1 \\
\hline
A2 & B2 & C2 & D2 & E2 & F2 & G2 & H2 & I2 \\
\hline
A3 & B3 & C3 & D3 & E3 & F3 & G3 & H3 & I3\\
\hline
\end{tabular}

\end{document}


• Thank you. If I intend to expand and create more columns like Title8, then what changes should I make in the code? – Dark_Knight Dec 25 '17 at 16:55
• Add in the preamble other pairs of column specifies like l@{\qquad}l, or if there are more consecutive such pairs of columns, *{n}{l@{\qquad}l} (n is the number of pairs of columns), and \multicolumn{2}{c|}{\makecell{...}} for each pair of columns with a common head. Note the value of the spacing between columns (@{\qquad}`) depends on the real content of the cells. Also, I doubt it would fit on the page width if there are more columns… – Bernard Dec 25 '17 at 17:03