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
& & \\
& & \\
& & \\
& & \\
& & \\
& & \\


  • 4
    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

It's easy:




You can also use:

|improve this answer|||||
  • 1
    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
  • 1
    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:

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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