I managed to get alternating row colours working when using tabular but when I converted them to tabulary to make the tables match \textwidth the row colouring became messed up.

Now it completely ignore the defined starting row and also changes the colour of the rows depending on the number of rows in the table. For example if there are an odd number of rows the top cell is grey, but when I add another row and make the number of rows even, the top cell becomes white. My code for such a table is below:

\textbf{ID} & \textbf{Requirement} \\ \hline
REQ1      & Requirement 1 \\
REQ2      & Requirement 2 \\
\caption{Functional Requirements}
\label{table:Functional Requirements}

Tenter image description herehis gives:


write into the preamble after loading tabulary:


This gives:

enter image description here

or without loading a package:


It is a problem with all tabular packages which read its contents twice for calculating the width but does not reset the line counter.

  • Ahh that makes sense, also explains why my row counter started returning funny values too. Answer works perfectly, thank you! – Oli Walker Dec 9 '13 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.