# LaTeX newbie and trying to make a complicate table

I am fairly new to LaTeX. I learned how to make basic tables with LaTeX by using:

\begin{table}[t]
\centering
\begin{tabular}{ |c|c|c|c| }
...
\end{tabular}
\end{table}


However, I am in a circumstance where I need to make a far more complicate table, which is shown below:

The color of the line is irrelevent, I just decided to use the color red for some of the lines just to make it easier to read. These lines do not need to be red.

I searched over the internet for hours to learn how to make a table like this, but I could not make any progress. I know this is rather a daunting question, but can someone please help me with how to make a table like this on LaTeX?

I will make changes to this post if there is any request.

Thank you,

• if showing the entire table is too daunting, could someone teach me how to write LaTeX code for making just the $C_1$ portion? Thank you.... – jschnieder Dec 18 '20 at 22:39
• maybe try tablesgenerator.com to get started. – davyjones Dec 19 '20 at 15:34

An example:

\documentclass[margin=5mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{siunitx}
\begin{document}
&        &             & \multicolumn{2}{c}{Avg min cost} \\
\cmidrule{4-5}
& {$t$}  & {$P_{win}$} & {random search} & {grid search}  \\
\toprule
\multirow{4}{*}{$C_1$}
& $10$   & 0.34        & 100.2           & {N/A}          \\
& $50$   & 1.34        & -0.00002        &                \\
& $100$  & -7.3        & {---}           & 123.2          \\
& $1000$ & 1300        & 14              & .34            \\
\midrule
\multirow{4}{*}{$C_2$}
& $10$   &             &                 &                \\
& $50$   &             &                 &                \\
& $100$  &             &                 &                \\
& $1000$ &             &                 &                \\
\midrule
\multirow{4}{*}{$C_3$}
& $10$   &             &                 &                \\
& $50$   &             &                 &                \\
& $100$  &             &                 &                \\
& $1000$ &             &                 &                \\
\bottomrule
\end{tabular}
\end{document}


• Thank you very much for your help, I really appreciate it. – jschnieder Dec 18 '20 at 22:42
• Hello, sorry to bother you again, but is there any way that I can align the numbers nicely? like for example, the number 1300 is not aligned with 0.34 and -7.3... thank you again, – jschnieder Dec 18 '20 at 22:48
• @jschnieder 1300 is perfectly aligned (on decimal separator). – Paul Gaborit Dec 18 '20 at 23:21
• @jschnieder The S column (from siunitx) aligns material on the decimal marker... – Paul Gaborit Dec 19 '20 at 6:54