Coloring rows or columns in a table

We recently received the following question from a user and wanted to share our answer with the community:

Can I make every second row or column coloured in a table to give it a bit more structure?

This can be done by deviating table settings. In practice, this means adding an additional row on the top, on which a command is written within percentage signs. ( % … % )

You can use a command to colour odd (the first, the third etc) or even (the second, the fourth etc) rows or columns, when you combine that with the word background and the hex code for the desired colour. The hex code for light grey, for example, is #D9D9D9, and you can find other colours you might like on the following page:

Hence, if we wanted to colour all odd rows light grey, we would add the following row on the top of the table:

|| % odd rows background #D9D9D9 % ||

There is a wide range of further combinations of commands that can be put together, and I suggest you have a look at this page ( to make proper use of these features!