3

I want to create a tcolorbox:

Name

A1|B1|C1

M2|N2|K2

X3|Y3|Z3

My minimal code:

\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}

enter image description here

How can I add more columns and more rows?

Thanks

  • 6
    Go to the tcolorbox package manual and search for the keyword "table" or "tabular", you will find many results. – user156344 Mar 2 at 16:39
4
\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}

enter image description here

  • Very good. I left this question because it was impossible for me to solve it with the OP code. In fact the hatching creates only two lines or only two columns as per the manual. – Sebastiano Mar 3 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.