您好,我想提高这些颜色框的平等性。您可以看到阴影尺寸的差异。我尝试了该\strut
命令,但它对表格的改变太大了。这是我能做的最好的了。请帮忙找到解决方案。
\documentclass{article}
\usepackage{amsmath,xcolor}
\begin{document}
\[ \begin{tabular}{c|c}
\hline
\textbf{Factors of}\ \color{blue}{$\mathbf{6}$}\color{black}{} & \textbf{Sum
of Factors}\\ \hline
$1,6$ & $7$ \\ \hline
${\setlength{\fboxsep}{1.5pt}\colorbox{brown!50!white}{2,3}}$ &
${\setlength{\fboxsep}{1.5pt}\colorbox{brown!50!white}{6}}$ \\ \hline
\end{tabular} \]
\end{document}
答案1
您的问题已解决koleygr 的评论,所以我为你的代码添加了一些题外的建议:
\documentclass{article}
\usepackage{amsmath,xcolor}
\begin{document}
\[ \setlength{\fboxsep}{1.5pt}
\begin{tabular}{c|c}
\hline
\textbf{Factors of \textcolor{blue}{6}}
& \textbf{Sum of Factors} \\
\hline
1,6 & 7 \\
\hline
\colorbox{brown!50!white}{2,3}
& \colorbox{brown!50!white}{5\vphantom{,}} \\ % <--- as suggested koleygr
\hline
\end{tabular}
\]
\end{document}