How can I define a tabular with two columns in LaTeX, where the first column fills 30% of the page width and the second column fills the rest?
Asked
Active
Viewed 1.5k times
12
-
I guess you meant the "second column" and not the "second tabular", right? I corrected that for you. – Hendrik Vogt Mar 28 '11 at 18:48
2 Answers
11
You could use the tabularx package.
For example:
\usepackage{tabularx}
...
\noindent%
\begin{tabularx}{\textwidth}{p{.3\textwidth}X}
...
\end{tabularx}
tabularx has the advantage, that you can specify the whole width and use X type columns which fill up the remaining space.
Stefan Kottwitz
- 231,401
5
You could try something likes this:
\documentclass{article}
\begin{document}
\noindent\begin{tabular}{p{\dimexpr.3\textwidth}p{\dimexpr.7\textwidth-4\tabcolsep}}
some text some text some text & some text some text some text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\end{tabular}
\end{document}
The first column takes 30% of the \textwidth; the second column takes .7\textwidth minus 4 times \tabcolsep (the space between the column and its contents).
Gonzalo Medina
- 505,128