Quantcast
Channel: Tcolorbox rule width with table inside - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Tcolorbox rule width with table inside

$
0
0

Apparently, the boxrule command has not effect with an enhanced tcolorbox having a tabularx inside.

How can I specify the width of the frame arount the tabularx ?

Here is the MWE :

\documentclass{article}\usepackage[skins]{tcolorbox}\usepackage{array,tabularx}\usepackage{colortbl}\begin{document}% \usepackage{array,tabularx}% \usepackage{colortbl} - or - \usepackage[table]{xcolor}\tcbset{enhanced,fonttitle=\bfseries\large,fontupper=\normalsize\sffamily,    colback=yellow!10!white,colframe=red!50!black,colbacktitle=red!30!white,    coltitle=black,center title,    boxrule=10pt, % NO EFFECT}\begin{tcolorbox}[tabularx*={\arrayrulewidth0.5mm}{X|X|X},title=My table]    One& Two& Three \\\hline\hline    1000.00 & 2000.00 & 3000.00\\\hline    2000.00 & 3000.00 & 4000.00\end{tcolorbox}% EDIT : with a multicolumn as 1st cell this does not compile anymore\begin{tcolorbox}[boxrule=2pt,tabularx*={\arrayrulewidth2pt}{YY|YY|YY},    title=My table    ]    \multicolumn{2}{c|}{title}&   \multicolumn{2}{c|}{title}&   \multicolumn{2}{c}{title} \\\hline    2 & d & 3 & e & 4 & f \\\hline    title & \multicolumn{3}{|l|}{h} & \multicolumn{1}{c|}{title} & j \\\end{tcolorbox}\end{document}

EDIT : the first answer is alright for the 1st table in the MWE, but I'm using a multicolumn as 1st cell and this brings an Misplaces \omit error. MWE has been modified with the problematic table.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>