# How to create a descriptive table

So something along the lines of this:

I want to create a descriptive table for some variables of mine and need to vary the size of some of them, because some need more space to be explained properly. Which package would be optimal in allowing me to do this, since just a regular table does not allow me to enter a lot of text when I need it

• See the nomencl package. – John Kormylo Jun 2 '17 at 13:49
• That last half sentence of yours sounds wrong, you just need to use a column type where linebreaking will occur, e.g p{5cm}, which makes a 5cm wide column where the text will wrap, or you can have a look at the tabularx package and its X columns. – Torbjørn T. Jun 2 '17 at 15:02

I would go with tabularx, booktabs and siunitx which in order:

1. will offer the self-adapting "X" column
2. will provide the professional table rules
3. will provide the "dot-aligned" column S for tables

Also note that the "standard deviation" column is best suited as compact (standard deviation is a long text compared with the numbers below; try and change it), but I typeset it as a p column.

I also inserted an arraystretch to add vertical space among the lines

Then

\documentclass{article}
\usepackage{booktabs,tabularx}
\usepackage[input-decimal-markers=.]{siunitx}
\usepackage{lipsum}
\begin{document}

\begin{table}
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\textwidth}{@{}lXSS@{}}
\toprule
\multicolumn{1}{l}{Variable}&\multicolumn{1}{l}{Description}&\multicolumn{1}{r}{Mean}&\multicolumn{1}{p{1.5cm}}{Standard deviation}\\
\midrule
Health&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&0.8049&0.3928\\
Age&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&49.16&15.82\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}


yielding: