Adjust booktabs table width to content

booktabstableswidth

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.

Best Answer

As recommended in the comments: Using tabular instead of tabularx provides the solution.