I have a book and want to put a table with caption inside a "mdframed" theorem example style box. Without begin/end table and without caption I can do it. But with caption I can not. Below is my code:
\documentclass[openany]{book}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{changepage}
\usepackage{geometry}
\geometry{paperheight=9.8125in,paperwidth=8in, left=.5in,
right=.5in,top=.75in,bottom=.4375in }
\renewcommand{\rmdefault}{pag}
\usepackage{mdframed}
\mdfdefinestyle{exampledefault}{linewidth=2pt}
\usepackage{amsthm}
\newtheorem{my_example}{EXAMPLE}[chapter]
\begin{document}
\begin{adjustwidth}{2.25in}{0pt}
\chapter{first chapter}
\section{first section}
This is my first table:
\begin{table}[h!]
\begin{adjustwidth}{2.25in}{0pt}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline $x$ & $y$ & $z$ \\
\hline $a$&$b$ &$c$ \\
\hline
\end{tabular}
{\caption{my first table}} \label{table_first}
\end{center}
\end{adjustwidth}
\end{table}
Now I have this text box:
\begin{mdframed}[style=exampledefault]
\begin{my_example}\label{example_first}
I want to have another table here:
\begin{center}
\begin{tabular}{|c|c|c|}
\hline $a$ & $b$ & $c$ \\
\hline $x$&$y$ &$z$ \\
\hline
\end{tabular}
\end{center}
\end{my_example}
\end{mdframed}
\end{adjustwidth}
\end{document}


adjustwidthenvironments? – leandriis Jun 14 '19 at 19:30