# Use of \hiderowcolors & \showrowcolors within LyX

Loading the xcolor package with the `[table]` option provides the command(s) `\rowcolors`(`*`) for alternate table row coloring. Any attempt, however, to use `\hiderowcolors` and `\showrowcolors` inside table rows within from LyX -- both in- and outisde a LyX table-float -- results in failing to compile a PDF. The error message is: `Undefined control sequence`.

It seems that there is no discussion/question upon this on either LyX-Users' mailing list or tex.stackexchange itself. It certainly is preferable to resolve this in a clean way, i.e. with a correct usage of the above mentioned commands.

-

I suspect that you simply haven't left any space between the ERT containing `\hiderowcolors`/`\showrowcolors`, so that TeX reads the letter(s) after the command as part of the command. E.g. if you put `\hiderowcolors` at the start of a table cell, and then write text right after the ERT, without spaces, TeX will see the command `\hiderowcolorstext`, which is undefined.
Solution: Put a pair of empty braces after `\hiderowcolors`, within the ERT. (You could also add a space after the ERT, but that will lead to wrong alignment.)
Wouldn't it be nice though to be able to instruct `\rowcolors{no. of starting row}{no. of ending row}{1st color}{2nd color}`? –  Nikos Alexandris Jun 27 '12 at 12:24
I think this could be seen as an enhancement request to xcolor... So it'd better be directed to `xcolor` directly. This is why I did not already asked for that. –  Nikos Alexandris Jun 27 '12 at 12:37