当我在某个单元格中使用颜色时,该单元格会变宽。如何解决?
代码在这里:
\documentclass{beamer}
\usepackage[utf8x]{inputenc}
\usepackage{default}
\mode<presentation> {
\usetheme{Warsaw}
\usecolortheme{crane}
}
\newcommand{\green}[1]{\begingroup\color{green}#1\endgroup}
\begin{document}
\begin{frame}
\begin{table}
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{3.5cm}|}
\hline
& CCCC & UUUUU\\
\hline
\hline
AAAAAAAA & itself & \green{BBBBBBBBBBBBB}\\
\hline
AAAAAAAA & itself & BBBBBBBB\\
\hline
\end{tabular}
\end{table}
\end{frame}
\end{document}
答案1
使用
\newcommand{\green}[1]{\textcolor{green}{#1}}