Table rowspan and colspan
You could use the multirow
package to organize the cell in the north-west corner of the table, and the tabularx
package to automatically generate four columns of equal width. In the MWE below, the \newcolumntype
instruction sets up a new column type, called "Y", that centers its contents. Adjust the value of the \arraystretch
macro to get the amount of vertical stretching to your liking.
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{multirow,tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\renewcommand{\arraystretch}{2}
\begin{document}\pagestyle{empty}
\begin{tabularx}{\textwidth}{|*{4}{Y|}}
\hline
\multirow{2}{*}{State of Health}
&\multicolumn{2}{c|}{Fasting Value}&After Eating\\
\cline{2-4}
&Minimum &Maximum &2 hours after eating\\
\hline
Healthy &70 &100 &Less than 140\\
\hline
Pre-Diabetes &101 &126 &140 to 200\\
\hline
Diabetes &More than 126 &N/A &More than 200\\
\hline
\end{tabularx}
\end{document}
The http://www.tablesgenerator.com/ site is helpful - it also knows about multicolumn.
More a comment than an answer, since this is likely to be aiming a clinical or scientific audience, tables should not have lines with a few exceptions. Referenced on Beautiful table samples I was very happy with https://www.inf.ethz.ch/personal/markusp/teaching/guides/guide-tables.pdf .
For comparison, this is how you can typeset the same table in ConTeXt. (Notice the similarity between the HTML markup (had you used CSS) and the TeX markup).
\setuppapersize[A4,landscape]
\startsetups table:layout
\setupTABLE
[
width=150pt, % Fixed column width
height=2\lineheight, % Fixed row height
align={middle,lohi}, % Middle aligned cells
frame=on, % Border around cells (default)
offset=none, % Equivalent to cellpadding=0
]
\stopsetups
\starttext
\bTABLE[setups=table:layout]
\bTR
\bTD[ny=2] State of Health \eTD
\bTD[nx=2] Fasting Value \eTD
\bTD After Eating \eTD
\eTR
\bTR
\bTD Minimum \eTD
\bTD Maximum \eTD
\bTD 2 hours after eating \eTD
\eTR
\bTR
\bTD Healthy \eTD
\bTD 70 \eTD
\bTD 100 \eTD
\bTD Less than 140 \eTD
\eTR
\bTR
\bTD Pre-Diabetes \eTD
\bTD 101 \eTD
\bTD 126 \eTD
\bTD 140 to 200 \eTD
\eTR
\bTR
\bTD Diabetes \eTD
\bTD More than 126 \eTD
\bTD N/A \eTD
\bTD More than 200 \eTD
\eTR
\eTABLE
\stoptext