# Control width of columns in a tabular environment

I would like the pieces of texts in the right column to be closer to the pieces of text in the left column. At the same time, I want the table to accommodate long pieces of text nicely, as it does now. One way to achieve this result would be to restrict the width of the left column, augment the width of the right column, and move the left margin of the right column to the left. But I do not know how to do it.

Here is a MWE of what I got so far:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}

\begin{document}

\begin{table}
\centering
\begin{tabular}{*{2}{p{.425\linewidth}}}
\toprule
first &  second second second second second second second second second second\\
\midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \\
\bottomrule
\end{tabular}
\end{table}

\end{document}


• You're probably looking for a setup like \begin{tabularx}{\linewidth}{ l X } ... \end{tabularx} (requires \usepackage{tabularx} in your preamble). – Werner Mar 19 at 15:27
• Thanks very much. This indeed achieves the goal. – orient Mar 19 at 15:50

As far as I understand the question, I would try

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}

\begin{document}
\begin{table}
\centering
\begin{tabular}{l p{0.5\linewidth}}
\toprule
first &  second second second second second second second second second second\\
\midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \\
\bottomrule
\end{tabular}
\end{table}
\end{document}


to obtain

• Thanks, Denis. Your solution also works and is indeed using just the package booktabs. – orient Mar 19 at 15:51

As @Werner has already pointed out in a comment, a good candidate solution for your formatting objective would be to load the tabularx package and to employ a tabularx environment (with overall width set to \textwidth) instead of tabular. Then, change the first column specification from p{...} to l, and change the second column specification from p{...} to X.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{tabularx} % for "tabularx" env. and "X" column type

\begin{document}

\begin{table}
\begin{tabularx}{\textwidth}{@{} l X @{}}
\toprule
first & second second second second second second second
second second second second second second second second \\
\midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \\
\bottomrule
\end{tabularx}
\end{table}

\end{document}

• Thanks very much, Mico. Your idea does provide the solution. – orient Mar 19 at 15:51