I'm new to Latex and am working TexShop on a MAC OS.
I wanted to create a table with subdivided columns and rows to describe my data, but I seem to have no luck trying to do it with the help of booktabs or array. Basically creating the column where i divide Group A into two more columns, and group B into two more columns is where I'm stuck.
Could somebody please help me out with how to create this kind of table?
EDIT: I want to make the titles bold and colour the table, like we can in Word or Powerpoint. Also, I want to get rid of the horizontal line on the two ends of the top row.
\documentclass{article}
\usepackage{tabularx}
\usepackage{array}
\usepackage{multirow}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage{booktabs}
\usepackage{caption}
\usepackage[bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}
\newlength\Colwd
\setlength\Colwd{1.2cm}
\begin{document}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{|l|}{Affected} & \multicolumn{2}{|l|}{Unaffected} & Total\\
\hline
& Kids & Adults & Kids & Adults&\\
\hline
Male & 144&15&34&89&282\\
Female & 37&6&66&109&218\\
Total&181&21&99&198&500\\
\hline
\end{tabular}
\end{document}
Best Answer
I would do something like the following:
booktabs
(toprule, midrule, cmidrule, bottomrule)Code: