![创建 tcolorbox-多行、多列](https://linux22.com/image/391502/%E5%88%9B%E5%BB%BA%20tcolorbox-%E5%A4%9A%E8%A1%8C%E3%80%81%E5%A4%9A%E5%88%97.png)
我想创建一个tcolorbox
:
Name
A1|B1|C1
M2|N2|K2
X3|Y3|Z3
我的最小代码:
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\begin{document}
\begin{tcbraster}[colback=red!15!white,colframe=red!65!black,
fonttitle=\bfseries,fontlower=\itshape] %
%
\begin{tcolorbox}[sidebyside,title=Name]
A1
\tcblower
B1
%\includegraphics[width=2cm]{Minion_Tips.png}
\end{tcolorbox}
\end{tcbraster}
\end{document}
我如何添加更多列和更多行?
谢谢
答案1
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\usepackage{tabularx,colortbl}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document} %
%
\begin{tcolorbox}[title=Name,
width=5cm,
colback=red!15!white,
colframe=red!65!black,
fonttitle=\bfseries,
tabularx={C|C|C},
]
%
A1 & B1 & C1\\
M2 & N2 & K2 \\
X3 & Y3 & Z3
%
\end{tcolorbox}
\end{document}