[Tex/LaTex] adjusting column width tabularx + table margin

tablestabularx

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
  \caption{Add caption}
    \begin{tabularx}{\textwidth}{>{\raggedleft\arraybackslash}XXXXX}
    \addlinespace
    \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}%
  \label{tab:addlabel}%
\end{table}%


\end{document}

Best Answer

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: enter image description here

\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]
  \caption{Add caption}
  \noindent\hspace*{-1cm}\begin{tabularx}{\textwidth+2cm}{
>{\raggedleft\arraybackslash\advance\hsize1em}X
>{\raggedright\arraybackslash\advance\hsize1em }X
>{\raggedright\arraybackslash}X
>{\raggedright\arraybackslash\advance\hsize-1em }X
>{\raggedright\arraybackslash\advance\hsize-1em }X
}
    \addlinespace
    \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}%
  \label{tab:addlabel}%
\end{table}%

\noindent aaa\dotfill aaa


\noindent aaa\dotfill aaa



\end{document}