Results 1 to 2 of 2

Thread: Custom table borders with CSS

  1. #1
    Join Date
    Aug 2009
    Location
    Cambridge
    Posts
    2

    Custom table borders with CSS

    Hi all,

    I'm having an issue with customizing my table borders with CSS. I did this awhile ago but couldn't find the tutorial. Basically what I wanna do is give a table custom borders, the table would have multple rows of data, an example would be a 1 px border around the entire table, but certain table rows holding a border around it.

    I'm sure it's a very easy method but I don't have the time to fool around with it for a couple hours. If what I'm trying to do is not understood just message asking for the code...another thing, is there a certain way to cut and paste code in the forums, or do I just...well...cut and paste? I'm new to the site so any help would be greatfully appreciated!

    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    You can give the outside of the table a border with
    <table style="border: 1px solid black">

    and then a border to individual td tags with
    <td style="border-right: 1px solid red">

    or border-bottom -top or -left

    or give a class to the table tag or td tag with the styles in a stylesheet.

    To make the other td tags have no border you may also have to add the general style
    td { border: none; }

    For forum code start with
    [ code]
    then copy/paste code here, then
    [ /code]

    (no space between [ and code] I had to put a space to stop it operating the code).
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. CSS / Table Help
    By mattsoreco in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 15 Mar 2009, 11:56 PM
  2. CSS Table wrap failed?
    By dangerlarson in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 06 Sep 2005, 09:13 PM

Posting Permissions

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