I have a table that serves as an answer sheet in an exam. This is a legacy from previous year, when there were 4 sections in the exam. However, I now have 3 sections...so I want to remove the Section IV column (so basically 6 columns). Easy peasy, I thought...just remove 6 &representing column border from the end of each row (and do the corresponding for the 3 title rows). Unfortunately, that does not do the trick :-( The problem is that I dont understand the role of arraystretch and linewidth/tabcolsep up top...
To clarify, I do want the 3 sections to expand to take on the original table's width...
{\rowcolors{5}{black!15}{black!5}
\def\arraystretch{1.8}%
\begin{tabular}{ |p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}|p{\dimexpr 0.0416667\linewidth-2\tabcolsep}| }
\hline
\multicolumn{6}{|c|}{\textbf{SECTION I}} & \multicolumn{6}{|c|}{\textbf{SECTION II}} & \multicolumn{6}{|c|}{\textbf{SECTION III}} & \multicolumn{6}{|c|}{\textbf{SECTION IV}} \\
\multicolumn{6}{|c|}{\textbf{Name 1}} & \multicolumn{6}{|c|}{\textbf{Name 2}} & \multicolumn{6}{|c|}{\textbf{Name 3}} & \multicolumn{6}{|c|}{\textbf{Name 4}} \\
\multicolumn{6}{|c|}{\textbf{Analysis}} & \multicolumn{6}{|c|}{\textbf{Analysis}} & \multicolumn{6}{|c|}{\textbf{Analysis}} & \multicolumn{6}{|c|}{\textbf{Analysis}} \\
\hline
\# & A & B & C & D & E & \# & A & B & C & D & E & \# & A & B & C & D & E & \# & A & B & C & D & E &
\hline\hline
1 & & & & & & 1 & & & & & & 1 & & & & & & 1 & & & & & &
\hline
2 & & & & & & 2 & & & & & & 2 & & & & & & 2 & & & & & &
\hline
3 & & & & & & 3 & & & & & & 3 & & & & & & 3 & & & & & &
\hline
4 & & & & & & 4 & & & & & & 4 & & & & & & 4 & & & & & &
\hline
5 & & & & & & 5 & & & & & & 5 & & & & & & 5 & & & & & &
\hline
6 & & & & & & 6 & & & & & & 6 & & & & & & 6 & & & & & &
\hline
7 & & & & & & 7 & & & & & & 7 & & & & & & 7 & & & & & &
\hline
8 & & & & & & 8 & & & & & & 8 & & & & & & 8 & & & & & &
\hline
9 & & & & & & 9 & & & & & & 9 & & & & & & 9 & & & & & &
\hline
10 & & & & & & 10 & & & & & & 10 & & & & & & 10 & & & & & &
\hline
11 & & & & & & 11 & & & & & & 11 & & & & & & 11 & & & & & &
\hline
12 & & & & & & 12 & & & & & & 12 & & & & & & 12 & & & & & &
\hline
13 & & & & & & 13 & & & & & & 13 & & & & & & 13 & & & & & &
\hline
14 & & & & & & 14 & & & & & & 14 & & & & & & 14 & & & & & &
\hline
15 & & & & & & 15 & & & & & & 15 & & & & & & 15 & & & & & &
\hline
\end{tabular}}


tabularhas to end with a\\. In your code all occurences of\\right before a\hlineare missing. Thus your code shouldresult in multiple error messages upon trying to compile it. – leandriis Jun 12 '21 at 13:41