You could set the cell content in a varwidth
environment (from the varwidth
package). Here's a minimal example:

\documentclass{article}
\usepackage{varwidth}% http://ctan.org/pkg/varwidth
\setlength{\parindent}{0pt}% Just for this example
\begin{document}
\begin{tabular}{|l|}
\hline
\begin{varwidth}{\dimexpr\linewidth-2\tabcolsep}
\strut some text.
\end{varwidth} \\
\hline
\end{tabular}
\begin{tabular}{|l|}
\hline
\begin{varwidth}{\dimexpr\linewidth-2\tabcolsep}
\strut Quite a lot more text than in the first table.
\end{varwidth} \\
\hline
\end{tabular}
\begin{tabular}{|l|}
\hline
\begin{varwidth}{\dimexpr\linewidth-2\tabcolsep}
\strut Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non eros in sem blandit
scelerisque vitae ac velit. Etiam turpis mi, tincidunt adipiscing tincidunt nec, laoreet quis
metus. Nulla ut est eu odio tempus vulputate. Donec blandit tincidunt leo sit amet ultricies.
Maecenas commodo nunc in felis pulvinar elementum. In sapien metus, adipiscing dictum sollicitudin
ac, interdum et leo. Phasellus suscipit mi sed purus euismod molestie. Class aptent taciti sociosqu
ad litora torquent per conubia nostra, per inceptos himenaeos.\strut
\end{varwidth} \\
\hline
\end{tabular}
\end{document}
The use of \strut
is encouraged as minipage
s tend to strip the appropriate depth/height of the last/first line of the text block.
varwidth
package? Setting, testing and possibly resetting, I mean?varwidth
only executes things once, but then measures and reboxes things rather than re-executing the token list. So it is generally better (but rather more work than my 6-liner:-) so I'll give you a vote:-):)