Results 1 to 6 of 6

Thread: Giving My Table A Border With Space

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Giving My Table A Border With Space

    Hi All,

    I am trying to make my table do the attached, where it has a border around the entire table but has a 2px space edge... Like the attched image, any ideas?

  2. #2
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can you also add an image to a <tr> or <td> I want the cells to have diagonal lines and the only way I see that happening is adding a bg image... Anyone know about this?

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Try the following code

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    .outer
    {
    	border:2px solid blue;
    }
    </style>
    </head>
    
    <body>
    <table width="960" cellpadding="0" cellspacing="20" class="outer">
    <tr>
    <td width="100&#37;" valign="middle" align="center">
    
    <table border="1" width="940" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100">Hello</td>
    <td width="200">Hello world</td>
    <td width="300">Welcome</td>
    <td width="340">Testing</td>
    </tr>
    
    <tr>
    <td width="100">Hello</td>
    <td width="200">Hello world</td>
    <td width="300">Welcome</td>
    <td width="340">Testing</td>
    </tr>
    
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>

  4. #4
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That worked a treat thanks! Do you happen to know how I could make the top row and the last row of table bigger than the middle rows? I know I could just do this with px but am trying to start using em's...

  5. #5
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You can even specify the height of the first and last row of the table in such a way that it fits your requirements.

  6. #6
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    But can I do it using ems? Or do I need to give it a px value?

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
  •