I made a table that uses multicolumn and multirow.
I have not been able to find out how to color the rows correctly, I found some questions on this net but they do not work out for me.
Any one can help me with this one?
\documentclass{scrartcl}
\usepackage{booktabs}
\usepackage[utf8x]{inputenc}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage[table]{xcolor}
\definecolor{tableGreaterHeader}{RGB}{28, 69, 135}
\definecolor{tableHeader}{RGB}{211, 47, 47}
\definecolor{tableLineOne}{RGB}{245, 245, 245}
\definecolor{tableLineTwo}{RGB}{224, 224, 224}
\rowcolors{1}{tableLineOne}{tableLineTwo}
\arrayrulecolor{pink}
\begin{document}
\begin{table}[h!]
\begin{center}
\caption{Minimal booktabs example.}
\label{tab:table1}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{l l l c c c c c c c c c c c c c c }
\toprule\rowcolor{tableGreaterHeader}
\\\rowcolor{tableGreaterHeader}
\multirow{2}{*}[-1em]{{\cellcolor{tableGreaterHeader}}Base material} & \multirow{2}{*}[-1em]{Thickness} & \multirow{2}{*}[-1em]{Amperage} & \multicolumn{5}{c}{Voltage} & \multicolumn{9}{c}{Wire feed speed}\\
\cmidrule(lr){4-8} \cmidrule(lr){9-17} \\\rowcolor{tableGreaterHeader}
{} & {} & {} & \(\mathrm{CO}_2\) & Ar 75 \% + \(\mathrm{CO}_2\) 25 \% & He + Ar + \(\mathrm{CO}_2\) & Ar & Ar 98 \% + \(\mathrm{O}_2\) 2 \% & Steel .030 & Steel 0.035 & Steel 0.045 & Stainless steel 0.035 & Stainless steel 0.045 & Stainless steel 0.063 & Al 4043 0.035 & Al 4043 0.045 & Al 4043 0.063 \\
\midrule % <-- Midrule here
\showrowcolors
\rowcolor{tableHeader}
\multicolumn{17}{c}{\textcolor{white}{Short circuit transfer mode}} \\
\midrule
Steel & & & & & & & & & & & & & & & & \\
& 22 ga & 40 - 55 & 16 - 17 & 15 - 16 & - & - & - & 90 - 100 & - & - & - & - & - & - & - & - \\
& 20 ga & 50 - 60 & 17 - 18 & 15 - 16 & - & - & - & 120 - 135 & 105 - 115 & - & - & - & - & - & - & - \\
& 18 ga & 70 - 80 & 18 - 19 & 16 - 17 & - & - & - & 150 - 175 & 140 - 160 & 70 & - & - & - & - & - & - \\
& 16 ga & 90 - 110 & 19 - 20 & 17 - 18 & - & - & - & 220 - 250 & 180 - 220 & 90 - 110 & - & - & - & - & - & - \\
& 14 ga & 120 - 130 & 20 - 21 & 17 - 18 & - & - & - & 250 - 340 & 240 - 260 & 120 - 130 & - & - & - & - & - & - \\
& 1/8 & 140 - 150 & 21 - 22 & 18 - 19 & - & & & - & 280 - 300 & 140 - 150 & - & - & - & - & - & - \\
& 3/16 & 160 - 170 & 21 - 22 & 18 - 19 & - & - & - & - & 320 - 340 & 160 - 175 & - & - & - & - & - & - \\
& 1/4 & 180 - 190 & 23 - 24 & 21 - 22 & - & - & - & - & 360 - 380 & 185 - 195 & - & - & - & - & - & - \\
& 5/16 & 200 - 210 & 23 - 24 & 21 - 22 & - & - & - & - & 400 - 420 & 210 - 220 & - & - & - & - & - & - \\
& 3/8 & 220 - 250 & 24 - 25 & 23 - 24 & - & - & - & - & 420 - 520 & 220 - 270 & - & - & - & - & - & - \\
& 1/2 & 300 & - & - & - & - & - & - & - & 375 & - & - & - & - & - & - \\
Stainless steel & & & & & & & & & & & & & & & & \\
& 18 ga & 50 - 60 & - & - & 19 - 20 & - & - & - & - & - & 120 - 150 & - & - & - & - & - \\
& 16 ga & 70 - 80 & - & - & 19 - 20 & - & - & - & - & - & 180 - 205 & - & - & - & - & - \\
& 14 ga & 90 - 110 & - & - & 20 - 21 & - & - & - & - & - & 230 - 275 & - & - & - & - & - \\
& 12 ga & 120 - 130 & - & - & 20 - 21 & - & - & - & - & - & 300 - 325 & - & - & - & - & - \\
& 3/16 & 140 - 150 & - & - & 21 - 22 & - & - & - & - & - & 350 - 375 & - & - & - & - & - \\
& 1/4 & 160 - 170 & - & - & 21 - 22 & - & - & - & - & - & 400 - 425 & - & - & - & - & - \\
& 5/16 & 180 - 190 & - & - & 21 - 22 & - & - & - & - & - & 450 - 475 & - & - & - & - & - \\
& 3/8 & 200 - 210 & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\
& 7/16 & 220 - 250 & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\
& 1/2 & 300 - 325 & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\\midrule \rowcolor{tableHeader}
\multicolumn{17}{c}{\textcolor{white}{Spray arc transfer mode}} \\
\midrule
Steel & & & & & & & & & & & & & & & & \
& 22 ga & 50 - 60 & - & - & - & - & - & 120 - 135 & 105 - 115 & - & - & - & - & - & - & - \
& 20 ga & 70 - 80 & - & - & - & - & - & 150 - 175 & 140 - 160 & 70 & - & - & - & - & - & - \
& 18 ga & 90 - 110 & - & - & - & - & - & 220 - 250 & 180 - 220 & 90 - 110 & - & - & - & - & - & - \
& 16 ga & 120 - 130 & - & - & - & - & - & 250 - 340 & 240 - 260 & 120 - 130 & - & - & - & - & - & - \
& 14 ga & 140 - 150 & - & - & - & - & - & - & 280 - 300 & 140 - 150 & - & - & - & - & - & - \
& 1/8 & 160 - 170 & - & - & - & - & 23 - 24 & - & 320 - 340 & 160 - 175 & - & - & - & - & - & - \
& 3/16 & 180 - 190 & - & - & - & - & 24 - 25 & - & 360 - 380 & 185 - 195 & - & - & - & - & - & - \
& 1/4 & 200 - 210 & - & - & - & - & 24 - 25 & - & 400 - 420 & 210 - 220 & - & - & - & - & - & - \
& 5/16 & 220 - 250 & - & - & - & - & 25 - 26 & - & 420 - 520 & 220 - 270 & - & - & - & - & - & - \
& 3/8 & 300 & - & - & - & - & 26 - 27 & - & - & 375 & - & - & - & - & - & - \
& 1/2 & 315 & - & - & - & - & 29 - 30 & - & - & 390 & - & - & - & - & - & - \
Stainless steel & & & & & & & & & & & & & & & & \
& 18 ga & 70 - 80 & - & - & - & - & - & - & - & - & 180 - 205 & - & - & - & - & - \
& 16 ga & 90 - 110 & - & - & - & - & - & - & - & - & 230 - 275 & - & - & - & - & - \
& 14 ga & 120 - 130 & - & - & - & - & - & - & - & - & 300 - 325 & - & - & - & - & - \
& 12 ga & 140 - 150 & - & - & - & - & - & - & - & - & 350 - 375 & - & - & - & - & - \
& 3/16 & 160 - 170 & - & - & - & - & 23 - 24 & - & - & - & 400 - 425 & - & - & - & - & - \
& 1/4 & 180 - 190 & - & - & - & - & 24 - 25 & - & - & - & 450 - 475 & - & - & - & - & - \
& 5/16 & 200 - 210 & - & - & - & - & 24 - 25 & - & - & - & - & 250 - 300 & - & - & - & - \
& 3/8 & 250 - 275 & - & - & - & - & 25 - 26 & - & - & - & - & - & 140 - 170 & - & - & - \
& 7/16 & 275 - 300 & - & - & - & - & 26 - 27 & - & - & - & - & - & 170 - 200 & - & - & - \
& 1/2 & 300 - 325 & - & - & - & - & 27 - 32 & - & - & - & - & - & 200 - 230 & - & - & - \
Aluminum & & & & & & & & & & & & & & & & \
& 1/8 & 110 - 130 & - & - & - & 21 - 22 & - & - & - & - & - & - & - & 350 - 400 & 240 - 270 & - \
& 3/16 & 140 - 150 & - & - & - & 23 - 24 & - & - & - & - & - & - & - & 425 - 450 & 300 - 325 & - \
& 1/4 & 180 - 210 & - & - & - & 24 - 25 & - & - & - & - & - & - & - & - & 350 - 370 & 170 - 185 \
& 5/16 & 200 - 230 & - & - & - & 26 - 27 & - & - & - & - & - & - & - & - & 400 - 425 & 200 - 210 \
& 3/8 & 220 - 250 & - & - & - & 26 - 28 & - & - & - & - & - & - & - & - & 450 - 480 & 220 - 230 \
& 7/16 & 280 & - & - & - & 28 - 29 & - & - & - & - & - & - & - & - & - & 240 - 270 \
& 1/2 & 300 & - & - & - & 29 - 30 & - & - & - & - & - & - & - & - & - & 290 - 300 \
\bottomrule % <-- Bottomrule here
\end{tabular}
\end{adjustbox}
\end{center}
\end{table}
\end{document}
Also, maybe a different question but there is white space surrounding the rules of the table, how can I get rid of them?
This is what I got




booktabspackage adds some spacing between the table rows, if this is not what you want, just use\hlines and don't load the booktabs package. Unrelated: you should probably not use\usepackage[utf8x]{inputenc}. – Jasper Habicht Jun 26 '23 at 05:51tabularraythat give you more flexibility with coloring and spacing. – Jasper Habicht Jun 26 '23 at 05:58