[Tex/LaTex] spacing between text and frame of table

tcolorbox

I use tcolorbox to define a new environment as suggested by Gonzalo at Create a color box?. In that environment, I put the figure inside the frame as the code shown below. I want to adjust the space beetween the frame of table and the figure. In my case I want no space both sides: left and right; and no space for top and bottom. Can you tell me how to adjust it?enter image description here

code is:

\documentclass[12pt]{book}
\usepackage{lettrine}
\usepackage[explicit]{titlesec}
\usepackage{xcolor}
\usepackage[many]{tcolorbox}
\usetikzlibrary{calc}
\usepackage[utf8]{vietnam}
\usepackage{fancyhdr}
\usepackage[explicit]{titlesec}
\usepackage[unicode]{hyperref}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{tcolorbox}

\newtcolorbox[auto counter, number within = chapter]{bang}[1][]{
colframe = myblue,
colback  = white,
coltitle = white,  
outer arc=0pt,
arc=0pt,
title    = {\bf Bảng ~\thetcbcounter} ,
#1,
}
\begin{document}
\begin{bang}
\includegraphics[scale=.78]{image/Chapter10/table10-1.png}
\end{bang}
\end{document}

Thanks!

Best Answer

You must set keys of colorbox: left, right, top, bottom to 0pt, and width of the inserted image to \linewidth

\documentclass[12pt]{book}
\usepackage{lettrine}
\usepackage[explicit]{titlesec}
\usepackage{xcolor}
\usepackage[many]{tcolorbox}
\usetikzlibrary{calc}
\usepackage[utf8]{vietnam}
\usepackage{fancyhdr}
\usepackage[explicit]{titlesec}
\usepackage[unicode]{hyperref}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{tcolorbox}

\definecolor{myblue}{RGB}{0,163,243}

\newtcolorbox[auto counter, number within = chapter]{bang}[1][]{
colframe = myblue,
colback  = white,
coltitle = white,  
outer arc=0pt,
arc=0pt,
left=0pt,
right=0pt,
top=0pt,
bottom=0pt,
title    = {\bf Bảng ~\thetcbcounter} ,
#1,
}
\begin{document}
\begin{bang}
\includegraphics[width=\linewidth]{example-image-a}%{image/Chapter10/table10-1.png}
\end{bang}
\end{document}
Related Question