# [Tex/LaTex] Beamer tables like block structure look-and-feel

beamertablestabu

I am trying to define a type of table similar to the look-and-feel of beamer blocks. I tried the following (using the tabu for tables), but with no luck.

\newenvironment<>{tabvarblock}[2][.9\textwidth]{%
%\setlength{\textwidth}{#1}
\begin{actionenv}#3%
\def\insertblocktitle{#2}
\begin{tabu}to#1{\insertblocktitle}%
\usebeamertemplate{block begin}}
{\end{tabu}%
\usebeamertemplate{block end}%
\end{actionenv}}


The use of the new structure would be, something like

\begin{tabvarblock}[0.5\textwidth]{X[m]X[m]}
A & B \NN
C & D \NN
\end{tabvarblock}


I also tried to use the solution in Example of fancy table using TikZ package. It worked, however the look-and-feel is not exactly the same.

The first approach is a \newenvironment that mix mdframed and tabular, but the same with tcolorbox instead of mdframed seem easier because this package have a beamer skin option. The first case is a fixed two columns but in the second the columns format is free (the second parameter of the new environment). You can compare both approaches in this MWE:

\documentclass{article}
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{MyFrame}{%
linecolor=gray!50,
outerlinewidth=0.01em,
skipabove=.5\baselineskip,
skipbelow=.5\baselineskip,
leftmargin=.25\textwidth,
rightmargin=.25\textwidth,
innertopmargin=1ex,
innerbottommargin=.5\baselineskip,
innerrightmargin=1em,
innerleftmargin=1em,
backgroundcolor=yellow!05!white,
frametitlerule=true,
frametitlerulecolor=blue!40!,
frametitlebackgroundcolor=blue,
frametitlerulewidth=0.05em}

\newenvironment{mdbeamer}[1]
{ \begin{mdframed}[style=MyFrame,
frametitle={\hfill\color{white}#1\hfill}]
\centering
\begin{tabular}{cc}
}
{ \end{tabular}
\end{mdframed}
}

\usepackage{tcolorbox}
\tcbuselibrary{skins}

\tcbset{colback=yellow!05!white,colframe=blue!95,
width=.5\textwidth,before=\hfill,after=\hfill}

\newenvironment{skinbeamer}[2]
{
\centering
\begin{tabular}{#2}
}
{ \end{tabular}
\end{tcolorbox}
}

\begin{document}

\begin{mdbeamer}{My mdframed  table}
A & B \\
C & D \\
\end{mdbeamer}

\begin{skinbeamer}{My tcolorbox table}{|c|c|}
\hline
A & B \\
\hline
C & D \\
\hline
\end{skinbeamer}

\end{document}