PDA

View Full Version : Borders on tables


Yinny
09-07-2005, 06:37 PM
I want a sharp border around my table. When I add border = 1 it adds two lines around my table and each of the cells. Any ideas as to what I'm doing wrong?

domedia
09-07-2005, 07:26 PM
what are you dsoing wrong? :)

First error is using html for style, this is a deprecated method, so we should use CSS.

In CSS you can do this (sample code from one of my websites):
#contact table {
background-color: #EFF6FF;
width: 450px;
border: 1px solid #D1DFEF;
border-collapse: collapse;
margin-left: 20px;
font-size: 12px;
}

#contact td {
border: 1px solid #D1DFEF;
padding-left: 4px;
font-family: arial, helvetica, sans-serif;
color: #000;
}

This will work for a contact table surrounded by a div id contact:

<div id="contact"><table>... </table></div>

abhi007
09-10-2005, 05:07 AM
Dont apply border=1 in HTML code, better you use CSS for this .
in css you can manage border better.


and ur result was 2 line in border because in one line for table itself and one for cell. so its 2 at the outer side of the table..

Hope this will help you