How do I indent text within a tabular environment?
You could insert an \hspace{<some length>}
directive at the start of cells. In the example below, I've set the length to 3mm
; you're obviously free to choose a different length.
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\noindent
\begin{tabular}{@{}lccc@{}}
\toprule
Factors & 2 & 2 & P-Value\\
\midrule
Age\\
\hspace{3mm}0--20 & 2 & 2 & 2\\
\hspace{3mm}21--55 & 2 & 2 & 2\\
\bottomrule
\end{tabular}
\end{document}
A slight improvement for the alignment of the left column (on the endash
):
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\noindent
\begin{tabular}{@{}rccc@{}}
\toprule
\multicolumn{1}{l}{Factors\hspace*{0.25em}} & 2 & 2 & P-Value\\
\midrule
\multicolumn{1}{l}{Age}\\
0--20 & 2 & 2 & 2\\
21--55 & 2 & 2 & 2\\
\bottomrule
\end{tabular}
\end{document}