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 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    table with 1px wide css borders

    I want to make a table where all of the borders (between every td) are 1px solid black. This may sound silly, but right now I'm putting a border on every td individually, and the problem with that is that IE renders both borders together creating a 2px border.

    How do you do this?

    Thanks!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    table {
    border-collapse:collapse;
    }

  • #3
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Like this ?

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
    <title></title>
    <style type="text/css">
    
    table {
    border-collapse: collapse;
    }
    
    td {
    border: 1px solid #000;
    padding: 10px;
    }
    
    </style>
    </head>
    
    <body>
    
    <table>
    	<tr>
    		<td>a</td> <td>b</td> <td>c</td>
    	</tr>
    	<tr>
    		<td>d</td> <td>e</td> <td>f</td>
    	</tr>
    </table>
    
    </body>
    
    </html>
    Edit, Aerospace beat me.

  • #4
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, exactly what I needed.


  •  

    Posting Permissions

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