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]{>{\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 & another\_long\_word\_without\_space & one\_more\_long\_word\_without\_space \\
A very very very unnecessarily long sentence & Another very very very unnecessarily long sentence & 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?



ptype columns in the code in their question. The problem in OP's case comes from the underscore caracters in "a_long_word_without_space".tabularxortabularymight 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? – leandriis Jan 06 '20 at 10:56