|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to make different css classes in the same table
Who can help me?
Per example: I want to make some different classes in one html-screen. here parts of the css contents: .gruen{font-family:helvetica,arial; font-size:13px; font-weight: bold; background-color:#b8bd9b;} .gruen1{font-family:helvetica,arial; font-size:13px; font-weight: bold; background-color:#d8dacf;} classes "gruen" and "gruen1" and I want them to make a nice table in the table rows, <tr> <TR VALIGN="bottom" class="gruen"> <TR VALIGN="bottom" class="gruen1"> So it has to become every second of the <tr>`s with the backgroundcolors from the style sheets. first <TR VALIGN="bottom" class="gruen"> second <TR VALIGN="bottom" class="gruen1"> third <TR VALIGN="bottom" class="gruen"> fourth <TR VALIGN="bottom" class="gruen1"> and so on... And I don`t want to do it in a long brutal manual way... because there are Hundred of html-files with the table... What can I do? thanks in hope of answers for questions I`m german from Berlin |
|
#2
|
|||
|
|||
|
The only way you can accomplish what you want programmatically, is if you have the content of your table coming from a seperate source (e.g.: a database or array) than the actual HTML of the table itself. If this is the case, then as you perform the loop in your code (either server-side code or client-side code, depending on whether you are using a database or array, respectively) for populating the table from the database, simply check the state of a boolean variable before you write each row (tr) and set the class accordingly. After you write the row, change the state of the variable so that you will be writing the other class the next time through.
__________________
Michael
|
|
#3
|
|||
|
|||
|
cruel world!
its not a dynamic style, its only static fiels to create... the data are already in, when i want to change this types of colors in the rows!! mfg |
|
#4
|
|||
|
|||
|
Sorry -- I don't think there is any way for you to do that (short of writing a script in whatever OS you are using that does the typing for you, but by the time you get that finished, you might as well have typed it in by hand).
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > how to make different css classes in the same table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|