[Tex/LaTex] How to create a Table like this in Latex

table of contentstables

How can I create a table like this in Latex?

enter image description here

I have tried but it didn't work. I need also that it is enumerated so that it appears in the List of Tables. It doesn't matter if it is not coloured, as long as the first two rows are bold.

\begin{center}
\begin{tabular}{ |c|c|c|c|c| } 
\hline
 \multicolumn{5}{|c|}{Number of cells per type} \\
 \hline

 a& b& c& d& e\\ 
  \hline
 44 & 39 & 7 & 32 &22 \\ 

 \hline
\end{tabular}
\end{center}

Best Answer

I suggest you to use booktabs for professional tables.

\documentclass[11pt,openright]{book}
\usepackage{array}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand{\arraystretch}{1.2}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{caption}

\begin{document}
\listoftables

\chapter{My chapter}
\begin{table}[htb]\centering
\caption{Your table\label{tab:yourtab}}
\begin{tabularx}{.5\linewidth}{ |C|C|C|C|C| } 
\hline
 \multicolumn{5}{|c|}{\bfseries Number of cells per type} \\
 \hline
 \bfseries a& \bfseries b& \bfseries c& \bfseries d& \bfseries e\\ 
  \hline
 44 & 39 & 7 & 32 &22 \\ 
 \hline
\end{tabularx}
\end{table}
\begin{table}[htb]\centering
\caption{My suggestion\label{tab:mytab}}
\begin{tabularx}{.5\linewidth}{*5C} 
\toprule
 \multicolumn{5}{c}{\bfseries Number of cells per type} \\
 \midrule
 \bfseries a& \bfseries b& \bfseries c& \bfseries d& \bfseries e\\ 
  \midrule
 44 & 39 & 7 & 32 &22 \\ 
 \bottomrule
\end{tabularx}
\end{table}
\end{document}

enter image description here

enter image description here

Related Question