# adjusting column width tabularx + table margin

As you can see from the following MWE, it would be really great to adjust the widths individually for a couple of columns individually. Also how can I decrease the page margins of the table, if the need arises?

\documentclass{article}
%\usepackage{showframe}% http://ctan.org/pkg/showframe
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{tabularx}% http://ctan.org/pkg/tabularx
\begin{document}

\begin{table}[htbp]
\centering
\begin{tabularx}{\textwidth}{>{\raggedleft\arraybackslash}XXXXX}
\toprule
\multicolumn{1}{c}{Variable } & Source & Spatial coverage & Temporal coverage & Frequency \\
\midrule
Urban Social Disturbances & USDAA, PRIO, Oslo & 55 cities (49 countries) & 1960-2010 & Event-based \\
Local food prices & FAO GIEWS database  & 43 markets (in common with USDAA) & 1990-Present (unbalanced) & Monthly \\
Total population & WDI 2010, World Bank & 190 countries & 1960-2011 & Annual \\
Urban population (as p.c. of total) & WDI 2010, World Bank & 190 countries & 1960-2011 & Annual \\
Internet penetration & WDI 2010, World Bank & 177 countries & 1960-2011 & Annual \\
Percapita GDP (constant, 2000 level) & WDI 2010, World Bank & 248 countries & 1960-2011 & Annual \\
Index of democracy & QoG database, U of Gothenberg & 202 countries & 1960-2011 & Annual \\
\bottomrule
\end{tabularx}%
\end{table}%

\end{document}

-
Please indicate which columns' widths you need to adjust. – Mico May 20 '12 at 10:34
@Mico say 1 and 3 – Abhimanyu Arora May 20 '12 at 10:35

This makes some columns wider than others, makes all columns ragged left or right and makes the table wider than the page. You may want to fiddle with the numbers to get the look you want:

\documentclass{article}
%\usepackage{showframe}% http://ctan.org/pkg/showframe
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{tabularx}% http://ctan.org/pkg/tabularx
\usepackage{calc}
\begin{document}

\begin{table}[htbp]
\noindent\hspace*{-1cm}\begin{tabularx}{\textwidth+2cm}{
>{\raggedright\arraybackslash}X
}
\toprule
\multicolumn{1}{c}{Variable } & Source & Spatial coverage & Temporal coverage & Frequency \\
\midrule
Urban Social Disturbances & USDAA, PRIO, Oslo & 55 cities (49 countries) & 1960-2010 & Event-based \\
Local food prices & FAO GIEWS database  & 43 markets (in common with USDAA) & 1990-Present (unbalanced) & Monthly \\
Total population & WDI 2010, World Bank & 190 countries & 1960-2011 & Annual \\
Urban population (as p.c. of total) & WDI 2010, World Bank & 190 countries & 1960-2011 & Annual \\
Internet penetration & WDI 2010, World Bank & 177 countries & 1960-2011 & Annual \\
Percapita GDP (constant, 2000 level) & WDI 2010, World Bank & 248 countries & 1960-2011 & Annual \\
Index of democracy & QoG database, U of Gothenberg & 202 countries & 1960-2011 & Annual \\
\bottomrule
\end{tabularx}\hspace*{-1cm}%
\end{table}%

\noindent aaa\dotfill aaa

\noindent aaa\dotfill aaa

\end{document}

-

For a more high-level column definition, you could use tabu. The code below makes the first two columns twice as wide as the others. X[3,c] would give you a centered column that is three times the width of a 1-unit-column, the latter being dynamically calculated from the table width (which, as in your example, is \textwidth).

\usepackage{booktabs}
\usepackage{tabu}

\begin{table}[htbp]
\centering
\begin{tabu} to \textwidth {X[2,l]
X[2,l]
X[1,l]
X[1,l]
X[1,l]}