Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Adding a border to a table WITHOUTcell lines being affected too?

Options
  • 28-02-2007 5:57pm
    #1
    Registered Users Posts: 1,795 ✭✭✭


    Hi guys,

    I don't know IF there is a solution to this problem - well, query, actually.

    In the DW environment, when a table is inserted, the property for borders is quite lame. I mean, you select the border thickness and colour, and ANY & ALL border lines (those making up the perimeter and the internal cells) get lined the same way. Is there a way to just do the table BORDER? I know there is the alternate way of inserting the celled table into a cell-less table of the same size (column width and height elements cleared to make it match) in order to achieve the same end result.

    Any ideas please?

    Seanie.


Comments

  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <style type="text/css">
    table {
    	border: 1px solid #CCC;
    }
    td {
    	border: none;
    }
    </style>
    <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    
    </body>
    </html>
    

    CSS should do it.


  • Registered Users Posts: 1,795 ✭✭✭Seanie M


    Cheers mcelhinney. I wonder if I just added the code line

    [code]

    td {border: none; other: properties;...}

    as part of the line of code for the cells in question... I must give it a go next time I have it open and give that a shot.

    Seanie.


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    you can also give the table a background color and use cellpadding = "1" border="0px"


  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    Seanie M wrote:
    Cheers mcelhinney. I wonder if I just added the code line
    
    td {border: none; other: properties;...}
    
    as part of the line of code for the cells in question... I must give it a go next time I have it open and give that a shot.
    
    Seanie.[/QUOTE]
    
    You could do that. But inline CSS is a nightmare to manage. How about a CSS class?
    
    [code]
    td.no-border {
           border: none;
    }
    

    and then just have this inline instead
    <td class="no-border">This is a sample with no border</td>
    <td>This is a sample with a border</td>
    

    this should get you sorted.

    louies point is also valid, but I recommend CSS.


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    I should have mentioned the use of border="0px"
    in a css file cause thats what I meant.


  • Advertisement
Advertisement