我想创建一个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}