Title: Unable to Wrap Text inside Table in Beamer
Tags: tables;beamer;text;wrap
Question: I am trying to add a table in my beamer presentation. Please see the code below:
\documentclass{beamer}
\usetheme{Madrid}
\usepackage{array}
% break long word in tabular
% src: https://tex.stackexchange.com/a/338524
\newcolumntype{P}[1]{&gt;{\hspace{0pt}}p{#1}}
\begin{document}
\begin{frame}{My Title}
\begin{table}
\newcommand{\ColWidth}{0.3\linewidth}
\begin{tabular}{|P{\ColWidth}|P{\ColWidth}|P{\ColWidth}|}
a\_long\_word\_without\_space                &amp; another\_long\_word\_without\_space                &amp; one\_more\_long\_word\_without\_space               \\
A very very very unnecessarily long sentence &amp; Another very very very unnecessarily long sentence &amp; One more very very very unnecessarily long sentence \\
\end{tabular}
\caption{Wrap Text Inside Table}
\end{table}
\end{frame}
\end{document}
Below is the screenshot of generated output:
How to enable text wrapping inside a table?


Here is another answer: Courtesy @musarithmia --  https://tex.stackexchange.com/a/196875/197451
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&gt;}. 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 &amp; Data &amp; Data &amp; Data &amp; 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 &amp; Data &amp; Data &amp; Data &amp; Data\\
\end{tabulary}
\end{table}
\end{frame}
%*******************
\end{document}
Comment for this answer: The OP alreeady used `p` type columns in the code in their question. The problem in OP's case comes from the underscore caracters in "a\_long\_word\_without\_space". `tabularx` or `tabulary` might on the other hand be a valid advise, however, OP seems to want to have three equally wide left aligned columns. Could you edit your answer to also reflect that instead of just literally copying other users answers?

Here is another answer: I found a workaround to the problem. The text wrapping is working fine for a sentence. However, text wrapping should be configured to work for underscore character too. Please see below the working code:
\documentclass{beamer}
\usetheme{Madrid}
\usepackage{array}
% break long word in tabular
% src: https://tex.stackexchange.com/a/338524
\newcolumntype{P}[1]{&gt;{\hspace{0pt}}p{#1}}
\begin{document}
\begin{frame}{My Title}
\begin{table}
\newcommand{\ColWidth}{0.3\linewidth}
% https://tex.stackexchange.com/a/9938
\renewcommand\_{\textunderscore\allowbreak}
\begin{tabular}{|P{\ColWidth}|P{\ColWidth}|P{\ColWidth}|}
a\_long\_word\_without\_space                &amp; another\_long\_word\_without\_space                &amp; one\_more\_long\_word\_without\_space               \\
A very very very unnecessarily long sentence &amp; Another very very very unnecessarily long sentence &amp; One more very very very unnecessarily long sentence \\
\end{tabular}
\caption{Wrap Text Inside Table}
\end{table}
\end{frame}
\end{document}
Please note that we allowed breaking on underscore characters locally by defining underscore as following \renewcommand\_{\textunderscore\allowbreak}. This workaround is taken from here
Below is a screenshot of the generated PDF:

{'source': 'StackExchangeDataset', 'subset': 'tex.stackexchange.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:01/06/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<tables><beamer><text><wrap>', 'Title': 'Unable to Wrap Text inside Table in Beamer', 'ViewCount': 1181, 'id': 523111, 'user_AboutMe': None, 'user_AccountId': 1205262.0, 'user_DisplayName': 'ravi', 'user_Reputation': 1548.0, 'user_Views': 93.0, 'user_id': 49520.0}}