在 Beamer 中创建表格时出错

在 Beamer 中创建表格时出错

我在 beamer 中使用的表格的代码如下:

         \begin{center}
         \begin{tabular}{|r|r|r|}
         \hline
         Risk&Meaning&Example\\
         \hline
          Project Risk&Affect the project schedule or resources&Loss of anexperienced designer\\
          \hline
          Product Risk&Affect the quality or performance of the software being developed&Failure of a purchased component to perform as expected.\\
          \hline
          Business Risk&Affect the organisation developing or procuring the software&A competitor introducing a new product is a business risk
           \end{tabular}
           \end{center}

如何纠正? enter image description here

答案1

您只是想在表格的一行中放入太多内容。纠正此问题的一种方法是设置最宽列的宽度,并允许 TeX 像处理表格外的常规段落一样换行。

\documentclass{beamer}
\begin{document}

\begin{frame}
  \begin{center}
    \begin{tabular}{|r|p{.3\textwidth}|p{.3\textwidth}|}
     \hline
     Risk& \hfill Meaning& \hfill Example\\
     \hline
      Project Risk&Affect the project schedule or resources&Loss of anexperienced designer\\
      \hline
      Product Risk&Affect the quality or performance of the software being developed&Failure of a purchased component to perform as expected.\\
      \hline
      Business Risk&Affect the organisation developing or procuring the software&A competitor introducing a new product is a business risk\\\hline
     \end{tabular}
  \end{center}
\end{frame}

\end{document}

tabular on slide with p{width} columns

相关内容