I need to find a package or else learn how to make a tex command definition that does something very similar to the \rowcolors
command for tables, for creating a table with alternating background color stripes, but with a couple of key differences.
First, although this is largely cosmetic, I would very much like the content of a cell to be vertically centered in the background. I notice that \rowcolor
tends to leave a larger margin at the bottom than it does at the top, and this looks weird when you have a striped table. All the text seems to be offset vertically from where it is looks like it should be.
More importantly, I want to be able to define the size of the group of row to color, so that unlike \rowcolors
where it alternates between two backgrounds each and every row, I want to be able to specify how many rows to group together. So while \rowcolors
would effective use a group size of only 1 row, I would like to be able to specify groups of two, three or four rows to group together, for example, and so alternate colors every two, three, or four rows, respectively. This question, which I initially thought was asking the exact same question I am, requires much more explicit coding throughout the table than what I was hoping for, where I was wanting something where I could easily just define all of my tables normally, and then easily go back to it and specify alternating color groups on the tables that needed it (as well as the size of the group to use for the table, of course). The aforementioned question I have linked to here seems to require that I explicitly mark the start of each group, and uses an additional command to actually generate each individual row.
I need the ability to specify which row of a table to start alternating the colors on, as well as a way to have different sizes of groups for different tables (or to turn it off completely). Whether this is done before the table starts or embedded into the row where the alternating colors begin is not important.
It is also of great importance to me that the solution must have a single solid block of unbroken color across all adjacent rows and columns with the same background specified. That is, there can be no thin bars of the normal page background separating the columns or rows. I mention this because I have seen both \rowcolor
and \columncolor
exhibit this behavior, although I have come to believe that this may be a matter of which tool I am using to render the resulting pdf.
If I have to define my own command for this, I'm going to have no idea how to begin. I'm a complete TeX newbie here, so I'm really hoping that either this already exists out there somewhere, or else it's easy enough to do that it could be explained simply here.