TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I use a table with alternately colored rows like this in a beamer slide? There seems to be a conflict with beamer and xcolor. I am using LyX too, bonus marks for something that works well in LyX.

\begin{tabular}{ r p{4cm} l}\hline
\textbf{col1} &\textbf{col2} &\textbf{col3}\\\hline
& & \\
& & \\
& & \\
& & \\
& & \\
& & \\


share|improve this question
The problem is that that beamer already loads xcolor, but without the table option. LaTeX generates an error if a package is loaded twice with different options. So you have to get the first instance to be loaded with the table option. – Caramdir Jan 12 '11 at 4:29
up vote 16 down vote accepted

It's easy:




You can also use:

share|improve this answer
I think the first option works in Lyx. You need to go to the toolbar and select Document -> Settings -> select "Document Class" from the sidebar -> Go to the "Custom" box in the "Class Options" section -> enter "table" – denilw Jan 12 '11 at 4:52
I face the same problem, in LyX, when both LyX' Track Changes function is active as well as the Show changes in output option. Entering the table or xcolor=table option does not help. Neither does the command \PassOptionsToPackage{table}{xcolor}. Any ideas? – Nikos Alexandris Jun 22 '12 at 15:00
It works using table as a document class option and, of course, erasing (if any) the \usepackage[table]{xcolor} entry from the Preamble. It does not work using xcolor=table. – Nikos Alexandris Jun 23 '12 at 1:48

You can also pass it as follows:

share|improve this answer
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, then they are marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Martin Scharrer Jul 27 '11 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.