Søren O'Neill wrote:
I've managed to get the backgrounds of rows in my table gray using colortbl, but it skips all multicolumn cells (i.e they are not gray'ed) - any suggestions ? I'll edit the raw lyx/latex file if needed :-)The following works for me (using package xcolor, which in turn calls colortbl).kind regards
1. In the preamble: \usepackage[table]{xcolor}.2. In ERT before the table: \rowcolors{1}{gray}. (The first argument says to start coloring in row 1, the second sets the background color.)
3. Right click in any multicolumn cell and put the following in the LaTeX command box: |>{\columncolor{gray}}c|. The 'c' is to center horizontally (use 'l' or 'r' for left or right); this inclusion apparently overrides the horizontal alignment specified in the drop-down list of the LyX dialog, and omitting it seems to cause a LaTeX error. The two '|' characters are replace the left and right cell borders (if either or both are deleted); include or omit as needed. Note that you apparently need to close the table dialog for these changes to take effect.
I've attached a small example. HTH, Paul
newfile1.lyx
Description: application/lyx