[Tex/LaTex] complex table with split and merged cells

tables

I would like to make a table like the one in the following screenshot. I could use \multicolumn to create the second row with S1,S2 etc. In the next stage i couldn't split the cells for 'V' and 'I'. complex table

Best Answer

The less vertical rules in a table, the better. If we accept this axiom, then zero is the right number of vertical rules. They serve no purpose and are simply a hindrance to reading.

Also horizontal rules should be used sparingly, mainly to separate chunks of rows that are linked together. Shifting a cell's content vertically is not needed: a blank cell in the table body means “repeat the value above”.

So here's my proposal for the table, that's quite similar to Svend Tveskæg, but differs from it in the placement of the row headers.

Note that \cmidrule(lr) is used for making clear how the groups of columns should be interpreted.

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{table}
\centering
\begin{tabular}{*{16}{l}}
\toprule
\multicolumn{2}{c}{Data1} & \multicolumn{14}{c}{Data2} \\
\cmidrule(lr){3-16}
&& \multicolumn{2}{c}{S1} & \multicolumn{2}{c}{S2}
 & \multicolumn{2}{c}{S3} & \multicolumn{2}{c}{S4}
 & \multicolumn{2}{c}{S5} & \multicolumn{2}{c}{S6}
 & \multicolumn{2}{c}{S7} \\
\cmidrule(lr){3-4}\cmidrule(lr){5-6}\cmidrule(lr){7-8}\cmidrule(lr){9-10}
\cmidrule(lr){11-12}\cmidrule(lr){13-14}\cmidrule(lr){15-16}
&& V & I      & V & I      & V & I      & V & I      & V & I      & V & I      & V & I      \\
\midrule
Subdata1 & Try1 &&&&&&&&&&&&&& \\
         & Try2 &&&&&&&&&&&&&& \\
\midrule
Subdata2 & Try1 &&&&&&&&&&&&&& \\
         & Try2 &&&&&&&&&&&&&& \\
\midrule
Subdata3 & Try1 &&&&&&&&&&&&&& \\
         & Try2 &&&&&&&&&&&&&& \\
\bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

Related Question