Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Table Class Help

    Hi Guys.

    This should be simple for most of you.
    I've got 10 tables, 9 with a border and 1 without.

    However, using CSS I can't seem to do both.

    Here my CSS code:
    Code:
    table
    {
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
    border-color: #CCC;
    border-style: solid;
    }
    
    td
    {
    margin: 0;
    border-width: 1px 1px 0 0;
    padding-left:5px;
    padding-right:5px;
    border-color: #CCC;
    border-style: solid;
    }
    
    TABLE.border
    {				
    border-collapse: collapse;
    empty-cells: show;
    border: 0px;
    padding: 0px;
    margin: 0px;
    }
    
    TD.border
    {
    padding: 4px;
    margin: 0;
    }

    Here is the table code that I don't want to have a border:
    Code:
    <table class="border" width="850" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table>

    Any help would be great

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Code:
    <table class="noborder" width="850" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table>
    Code:
    table, td{
    border:1px solid #000;
    border-collapse:collapse;
    }
    Code:
    table.noborder, table.noborder td{
    border:none;
    }
    PS: Are you using tables for making your layout? If so, read http://www.hotdesign.com/seybold/ first.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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