PDA

View Full Version : Custom table borders with CSS



Dioxide-Angel
13 Aug 2009, 06:18 PM
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!

Wickham
14 Aug 2009, 01:53 AM
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).