How do i alternate table rows with 2 seperate colours but i nid the header row to be of another colour. Is it possible? i am required to use the looping technique.
oh no i aint allowed to post pictures. but it looks something like a table with 5 rows and the header row is blue in colour while the other 4 rows are red>white>red>white
How do i alternate table rows with 2 seperate colours but i nid the
Share
Use
<c:forEach>with avarStatusand some lines of CSS.with CSS
In the above example, the header is just separated from the body. When the table row index in the body is a multiple of 2 (even), then it get
class="even", otherwiseclass="odd"(open page in browser, rightclick it and View Source to see it yourself). With CSS you can just control the style of the invididual elements. To give the header row a blue background, just add