This question is not specific to beamer
, so I'll put a general answer first and then a working example using beamer
.
To wrap text in a table column, here are two simple options:
Use tabular
and specify one of the columns as a paragraph with p{<width>}
. You must specify the width of that column, while the other columns will fit the width of the contents. The wrapped p
column will always be left aligned.
\begin{tabular}{p{15mm} c c}
Use one of the other table-making packages. The other answer
demonstrates tabularx
, which expands the columns to fill a
specified width for the whole table.
With tabulary
, you specify the width of the whole table, and then you can either choose traditional tabular-style columns with lowercase alignment commands c
, l
, and r
; or you can use uppercase commands to get a wrapping column. This way you can easily create a wrapping column with any alignment.
\begin{tabulary}{\textwidth}{C c c}
Example for beamer
:
The first frame uses tabular
and the second, tabulary
.
\documentclass{beamer}
\usepackage{tabulary}
\begin{document}
%*******************
\begin{frame}
\begin{table}
\begin{tabular}{p{15mm} | c | c | c | c }
Text that should wrap to multiple lines & Data & Data & Data & Data\\
\end{tabular}
\end{table}
\end{frame}
%*******************
\begin{frame}
\begin{table}
\begin{tabulary}{\textwidth}{C | c | c | c | c }
Text that should wrap to multiple lines & Data & Data & Data & Data\\
\end{tabulary}
\end{table}
\end{frame}
%*******************
\end{document}
array
package and usem{15mm}
.