I din't remember if this has already been mentioned in this thread, but you can 
do this simply with an Autoformat.

Just take 3 rows of your table (or create a special table for this). Then color 
the rows alternatively. Or you can color the header row with a different color 
if so desired. Then select these 3 rows and click "Table -> AutoFormat". Click 
"Add"" and give your autoformat a name. 
Then select the table to be formatted and Autoformat it with the newly created 
AutoFormat. You can indicate if you want a header row.

You can also create the AutoFormat in a Calc spreadsheet, but there you need at 
least a 3x3 rectangle. In a Writer table you only need at least 3 rows.

It is also possible to do striped columns, then you would need at least 3 
columns.

Some Caveats:
1. In Calc If you give the new AutoFormat a name that lexicographically sorts 
before "Default", e.g. when it starts with A, B or C, then it just disappears. 
In Writer that is not the case.

2. If you later insert or delete an odd number of rows from the table, they 
will no longer be alternatively colored. You will have to re-apply the format.

3. An autoformat has a column header (the first row) that you can disable when 
applying the AutoFormat. It also has a totals row at the bottom, and a rows 
header column and a totals column at the right that you cannot disable (This is 
a design error). If you don't color your columns differently the row header and 
Totals columns are no problem. But the Totals row always gets the color of the 
last row in the AutoFormat, and so if your AutoFormat has an even number of 
rows (excluding a possible header row), and your table has an odd number of 
rows, or vice versa, then the last row will get the wrong color. You can 
correct this by creating the table with one row more, and then deleting the 
last row. If you would have striped columns, I guess the same will happen in 
the other direction, but I haven't tried.

-- 
Piet van Oostrum <p...@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to