CowGirl
07-27-2008, 07:00 AM
Hi,
I use Dreamweaver CS3.
I have multiple pages, each of which has a table with many rows. I want every other row of these tables to be a different color (1st row would be white, 2nd row would be light blue, 3rd row would be white, etc.), so as to make it easier to read.
I have done this by creating two css class rules, one for the rows with white background and one for the rows with light blue backgrounds. I then put the cursor in each and every row (one row at a time) and set the row to the appropriate class. In doing so, I modified the <td> of each row (as opposed to the <tr> of each row).
The problem is that I will have to delete some of these rows on a regular basis. If I continue to do things as I have, once I delete a row I will have to put the cursor in each row below (one row at a time) and set the class to the appropriate class. This is going to be VERY time consuming.
In an effort to find a more efficient way of doing this, I experimented and found that by highlighting ever other row I can then set the class for all highlighted rows at the same time. The only problem is that this modifies the <tr> (as opposed to the <td>)
Thus, my question is is it ok to set the background of the row via <tr>, instead of <td>? Is there any disadvantage to doing so in this case? (All of these rows have one cell.) Is there any more efficient way of doing this?
Thank you for your time, CowGirl! Both my cows and myself appreciate your help!
I use Dreamweaver CS3.
I have multiple pages, each of which has a table with many rows. I want every other row of these tables to be a different color (1st row would be white, 2nd row would be light blue, 3rd row would be white, etc.), so as to make it easier to read.
I have done this by creating two css class rules, one for the rows with white background and one for the rows with light blue backgrounds. I then put the cursor in each and every row (one row at a time) and set the row to the appropriate class. In doing so, I modified the <td> of each row (as opposed to the <tr> of each row).
The problem is that I will have to delete some of these rows on a regular basis. If I continue to do things as I have, once I delete a row I will have to put the cursor in each row below (one row at a time) and set the class to the appropriate class. This is going to be VERY time consuming.
In an effort to find a more efficient way of doing this, I experimented and found that by highlighting ever other row I can then set the class for all highlighted rows at the same time. The only problem is that this modifies the <tr> (as opposed to the <td>)
Thus, my question is is it ok to set the background of the row via <tr>, instead of <td>? Is there any disadvantage to doing so in this case? (All of these rows have one cell.) Is there any more efficient way of doing this?
Thank you for your time, CowGirl! Both my cows and myself appreciate your help!