1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Adding borders to selected sides?

Discussion in 'Web Design & Development' started by The Infinity, Jan 16, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    Is it possible to add a border to the right and left side of a table and not the top and bottom?
     
  2. starcab

    starcab

    Joined:
    Dec 7, 2006
    Messages:
    98
    No I don't think so.
     
  3. JamesM

    JamesM

    Joined:
    Nov 18, 2006
    Messages:
    10
    Um actually you can by adding a somple CSS file to the .html file, just add this to the table and add a class tot he table and name this border. As you can see below there is no top and bottom, just left side and right side are all encased in a border.

    I keep making mistakes in typing I needs som sleep :(

    So here is a simple example.

    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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <link href="stylesheet.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="border">This is a test page</td>
      </tr>
    </table>
    </body>
    </html>
    Code:
    .border {
    	border-right: thin solid #222;
    	border-left: thin solid #222;
    	margin:0;
    	padding: 10px
    }
     
  4. Eriksrocks

    Eriksrocks

    Joined:
    Aug 7, 2005
    Messages:
    2,183
    Yeah, just use some CSS.
    HTML:
    style="border-left: 1px solid #FF0000; border-right: 1px solid #FF0000;"
     
  5. JamesM

    JamesM

    Joined:
    Nov 18, 2006
    Messages:
    10
    Yeah that's the one I could not remember, I was tired and sleepy and could not remember, this is probably the easiest way, although CSS style make it look neat instead of a load of messed up code on the page.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/535738

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice