6

I'm trying to design a good-looking table with Beamer. I'm following the tutorial here. In page 8 of that tutorial, the table is very nice, with alternating colored rows and a pleasant drop-shadow. Moreover, some vertical bars are black while others are grey:

enter image description here

However, when I follow that same code, I get something like this:

enter image description here

The code is pasted below:

\begin{center}
  \rowcolors{1}{RoyalBlue!20}{RoyalBlue!5}
  \begin{tabular}{|l|c|}\hline
    J.\ S.\ Bach & 1685--1750 \\
    W.\ A.\ Mozart & 1756--1791 \\
    L.\ Beethoven & 1770--1827 \\
    F.\ Chopin & 1810--1849 \\
    R.\ Schumann & 1810--1856 \\ \hline
  \end{tabular}
\end{center}

I looked around that tutorial but did not figure out how to achieve this effect. Could anyone help? Thanks in advance!

0

1 Answer 1

11

If I zoom the table on page 8 I don't see any drop shadow and all the rules are black; however, if you want to give a drop shadow to the table, you can put the tabular inside a \node and use the shadows library from TikZ:

\documentclass[xcolor={dvipsnames,table}]{beamer}
\usepackage{tikz}                   
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}
\begin{center}
\begin{tikzpicture}
\node[drop shadow,fill=white,inner sep=0pt] 
{\rowcolors{1}{RoyalBlue!20}{RoyalBlue!5}
  \begin{tabular}{|l|c|}\hline
    J.\ S.\ Bach & 1685--1750 \\
    W.\ A.\ Mozart & 1756--1791 \\
    L.\ Beethoven & 1770--1827 \\
    F.\ Chopin & 1810--1849 \\
    R.\ Schumann & 1810--1856 \\ \hline
  \end{tabular}%
};
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

enter image description here

On a side note, and just as a personal opinion, I would remove the vertical rules from the table.

Here's another option using \shadowbox from the fancybox package:

\documentclass[xcolor={dvipsnames,table}]{beamer}
\usepackage{fancybox}                   

\begin{document}

\begin{frame}
\begin{center}
\setlength\fboxsep{0pt}
\shadowbox{%
\rowcolors{1}{RoyalBlue!20}{RoyalBlue!5}
  \begin{tabular}{|l|c|}\hline
    J.\ S.\ Bach & 1685--1750 \\
    W.\ A.\ Mozart & 1756--1791 \\
    L.\ Beethoven & 1770--1827 \\
    F.\ Chopin & 1810--1849 \\
    R.\ Schumann & 1810--1856 \\ \hline
  \end{tabular}%
}
\end{center}
\end{frame}

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .