SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Removing style from one tag.

    I'm designing with css now, and use an external file. I'm looking through the W3 pages to make sure it's up to standards and so on.

    I use tables a lot in my art gallery, so I decided to put some style in the td tag. I want a border around each cell, and when using css I added this to my file:
    td {border:inset 2px;}
    And that makes all the cells have the inset.

    I have ONE table (a small one but with many cells) where I don't want the inset. Is there something I can put in the table tag so that the stylesheet is temporarily disabled in that table only? I don't want to have to define each cell seperatly.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not 100% sure... just a guess here...

    <td style="border: default !important;"> ... </td>
    ----Adopt-a-Sig----
    Your message here!

  3. #3
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about <table style="border: 0">?
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about

    td.no-inset {border:inset 0px;}

    and call
    <td class="no-inset">this will not have the inset</td>

  5. #5
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <table style="border: 0"> doesn't work. if I put the style in the <td>-tag it works. Problem... most of the table is created in a script, and I don't want to mess around with the script, because it isn't mine, and if I mess with it it might fall apart.

    So I really need to put something in the <table>-tag. Or maybe around the table so it doesn't look for the stylesheet when it displays the table.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see how you have much of a choice on this one .
    just add the td.no-inset to the style sheet, and go through the script slowly, and add class="no-inset" to the td tags where appropriate. I don't think you can go higher in the table structure to accomplish what you want.

    Good luck

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here, this will do it.

    <style>
    table.mySpecialTable tr td {border: 2px inset }
    </style>

    <table class="mySpecialTable">
    <tr>
    <td>-----</td>
    <td>-----</td>
    <td>-----</td>
    </tr>
    <tr>
    <td>-----</td>
    <td>-----</td>
    <td>-----</td>
    </tr>
    </table>

  8. #8
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Shoop! Worked like a charm! Now I know what to do when I need to change the style in one place only.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •