#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    365
    Rep Power
    12

    can css set custom borders for a table? (<table>)


    Hi all, what i want is to customise the borders of a table...
    i know that <div>'s can have custom borders but, for the way that the page works i used table tags <table>. (very little experience of using <div>)

    is there a way that css can manipulate the borders of a table?
    i tried using this css:

    .nmhead {
    border-color:#cccccc;
    border-top:border-top-style:none;
    border-left:border-left-style:none;
    border-right:border-right-style:double;
    border-bottom:border-bottom-width:5px;
    }

    and then in the table doing this:
    <td class='nmhead'>

    but it didnt work (attached is what i want it to look like)

    any ideas?
    Attached Images
  2. #2
  3. Über nübe
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Babylon 4
    Posts
    240
    Rep Power
    12
    Something like this?

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <html>
    <head>
    	<title>Untitled</title>
    </head>
    
    <body>
    <style type="text/css">
    
    
    
    .nmhead {
    border-color:#cccccc;
    border-top-style:none;
    border-left-style:none;
    border-right-style:double;
    border-bottom:1px solid #cccccc;
    
    }
    
    .nmhead2 {
    border-color:#cccccc;
    border-top-style:none;
    border-left-style:none;
    border-right:1px solid #cccccc;
    border-bottom:1px solid #cccccc;
    
    }
    
    </style>
    
    
    <table cellspacing="0" cellpadding="2">
    <tr>
    <td class='nmhead'>test 1</td>
    <td class='nmhead2'>123</td>
    <td class='nmhead2'>123</td>
    <td class='nmhead'>123</td>
    <td class='nmhead2'>369</td>
    
    </tr>
    
    
    <tr>
    <td class='nmhead'>test 2</td>
    <td class='nmhead2'>231</td>
    <td class='nmhead2'>231</td>
    <td class='nmhead'>213</td>
    <td class='nmhead2'>675</td>
    
    </tr>
    
    
    </table>
    
    
    </body>
    </html>
    Hello, old friend...
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    365
    Rep Power
    12
    Thanks for that
    found out the error in my code

IMN logo majestic logo threadwatch logo seochat tools logo