#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    2
    Rep Power
    0

    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. #2
  3. No Profile Picture
    Seņor Member
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2000
    Posts
    1,157
    Rep Power
    38
    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
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    2
    Rep Power
    0

    Unhappy


    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
  6. #4
  7. No Profile Picture
    Seņor Member
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2000
    Posts
    1,157
    Rep Power
    38
    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).
    Michael

IMN logo majestic logo threadwatch logo seochat tools logo