# Adjusting column width in tabularx [closed]

I have to following table (originally generated from R by the tables package and pruned for this question):

\begin{table}
\begin{tabularx}{0.49\textwidth}{XXXXXXX}
\toprule
$A$ & $B$ & $C$ & \multicolumn{2}{c}{ $D$ } & \multicolumn{2}{c}{$E$} \\
\midrule
100 & 0.25 & 100  & \multicolumn{1}{r@{}}{$0.21$} & \multicolumn{1}{@{ $\pm$ }l}{$0.06$} & \multicolumn{1}{r@{}}{$0.05$} & \multicolumn{1}{@{ $\pm$ }l}{$0.04$}\\
\bottomrule
\end{tabularx}
\end{table}


I would like the total width of the table fixed and the first three columns to take less space, leaving more for the multicolumns. I tried the solutions for related questions, but it didn't work out. Can anybody help please?

-

## closed as unclear what you're asking by Paul Gessler, Papiro, Jesse, Mico, Andrew SwannJan 27 at 10:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Then don't use X for those columns –  daleif May 22 '14 at 12:33
You don't want X for the first three columns so they are set natural width, and the multicolumn are over-riding the X entry on the remaining columns, and all entries appear to be in math mode, are you sure you don't want an array rather than tabularx? –  David Carlisle May 22 '14 at 12:51
Thank you David, I already suspected the overriding to be happening. Actually I'm automatically generating my latex tables form within the R environment, such that the 'stuff within the table' like line 6 should be taken 'as is' and not manually modified. I'm not sure if tabularx is actually the best way to do what I wanna do. –  Dominik May 22 '14 at 13:08