Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 28-02-2007 05:57PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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