PDA

View Full Version : Table Border is doubling between cells


Bry Man
10-23-2003, 10:28 PM
Hi I was trying to make a table for a menu that is styled using css,thats why im posting this here cuz Ive never had this problem with html by itself,and when I view it as a web page on my pc the borders between cells are doubled because they arent overlaping...can anyone help me out and tell me how to make it so its a 1px border all around?

Floyd
10-24-2003, 02:02 AM
Okay, my guess is that you're adding a border style to your table cells and the right-hand border of the left-hand cell, and the left-hand border of the right-hand cell are not doing the Right Thing and merging; there's a gap in between.

<style>
td{border:1px solid red;}
</style>
<table><tr><td>Cell1</td><td>Cell2</td></tr>
<tr><td>Cell3</td><td>Cell4</td></tr></table>


Try adding a style of "border-collapse:collapse;" to the table the cells are contained in; that will gobble the border the table itself puts between table cells.

<style>
table{border-collapse:collapse;}
td{border:1px solid red;}
</style>
<table><tr><td>Cell1</td><td>Cell2</td></tr>
<tr><td>Cell3</td><td>Cell4</td></tr></table>