Can somebody tell me how I can adjust a tabluarx' width to its content? Consider the following working example:
\documentclass[a4paper,twoside]{article}
\usepackage{booktabs} % for 'tabularx' environment
\begin{document}
\begin{table}[H]
\centering
\small
\begin{tabularx}{0.5\textwidth}{lrrrr}
\toprule
Parameter & mean & 2.5\% & 97.5\% & $\hat{R}$\\
\midrule
Intercept & 6.99 & 6.93 & 7.06 & 1\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
In the example, I set the table's width to \textwidth, but ideally I would want the table to automatically adjust its width to its content so that each column is only as wide as needed.
tabular;tabularxrequires at least one X column. – Bernard Sep 10 '21 at 13:51tabular– David Carlisle Sep 10 '21 at 14:07