CSS Tables - Simple question
-
Ok, this is quite a simple question. I'm changing my website to use CSS. And i thought hey, how about allowing the CSS to control my tables as well. So if we have a table, which the code looks like:
and we want to apply the CSS style to it. Do i have to create a style for everything, hence Table, tr and td. Because that is what i am doing, and it seams a little tedious.. hence it becomes
Is there a simplier way, so I don't have to apply the class to literally everything seperately :confused: --- Peter M
-
Ok, this is quite a simple question. I'm changing my website to use CSS. And i thought hey, how about allowing the CSS to control my tables as well. So if we have a table, which the code looks like:
and we want to apply the CSS style to it. Do i have to create a style for everything, hence Table, tr and td. Because that is what i am doing, and it seams a little tedious.. hence it becomes
Is there a simplier way, so I don't have to apply the class to literally everything seperately :confused: --- Peter M
Yes. When you specify that will work for your entire table. But when you want to use a different style for some cells you will have to specify
tag in your style sheet. Then every
would take that style. like: td { color: #FF0000; } And yes this was a really simple question, CAUSE I WAS ABLE TO ANSWER IT. Any tool is only as good as you can use it!! (http://www.pascalnet.tk)
-
Ok, this is quite a simple question. I'm changing my website to use CSS. And i thought hey, how about allowing the CSS to control my tables as well. So if we have a table, which the code looks like:
and we want to apply the CSS style to it. Do i have to create a style for everything, hence Table, tr and td. Because that is what i am doing, and it seams a little tedious.. hence it becomes
Is there a simplier way, so I don't have to apply the class to literally everything seperately :confused: --- Peter M
Peter: You can apply style to a table as a whole, or to the rows, or to the cells. If you use the html attributes, you can individually apply style how you want. If you are using css styles then rules such as these: table{} tr{} td{} apply styles that apply to the whole table, all rows, and all cells. If you want to have independent control you may use as shown in the next block of formatting: [cut and paste:-O in notepade and save with htm or html extension and open it in IE or Netscape.. ------------------- table{background-color:gold} .firstrow{background-color:pink} .lastcell{background-color:magenta}
Jay
Krish
Mysorian
India
----------------------