Sunday, 7 February 2016

How to Create Alternating Background Colors in Table Rows With CSSIn Feburary 2016 07,

In Feburary 2016 07,
Here's a simple table with alternating gray and white rows. This technique will work for any color scheme or any size table.
Build the table using your normal HTML table-building tools.
In the stylesheet, create a class that can be applied to alternating TR (table row) elements. Here's an example:
.rowcolor {
background: #CCCCCC;
}
In the HTML, add the class to alternating rows in your table. Apply it to the TR element. See image for example.
If you would like to have a different color for the row of the table that contains the headings, you can create a new class or id rule in your stylesheet that will only apply a background color to the TH elements.
In Feburary 2016 07,

No comments:

Post a Comment