Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table cell border: double border between cells

Status
Not open for further replies.

Stoemp

Programmer
Sep 25, 2002
389
BE
Hi

I'm trying to set the style of my table with css. I defined the style of a table cell with the following CSS properties:
Code:
.tdCell
{
	border: 1px solid black;
	FONT-SIZE: 13px;
	COLOR: #000000;
	background-color: #CDCDCD;
	FONT-FAMILY: Arial, Helvetica, sans-serif;
	TEXT-ALIGN: justify;
	TEXT-DECORATION: none
}

The table is set up like this:
Code:
<table style="width: 390px; border-collapse: collapse" cellspacing="0" cellpadding="0">
<tr>
	<th class="tdCell">&nbsp;Code</th>
	<th class="tdCell">&nbsp;Anticorps contre</th>
	<th class="tdCell">&nbsp;Ig-class</th>
	<th class="tdCell">&nbsp;Substrate</th>
</tr>
</table>

In between 2 cells, the border seems to be 2 pixels wide. I thought this could be changed with the border-collapse, but apparently this doesn't work. Any ideas what I do wrong?

Thanks

Steven
 
Try adding border="0" to your table definition. Strange that it works for me without that, however... What browser / OS are you experiencing the problem with?

Hope this helps,
Dan
 
Very strange... After having a smoke and refreshing the table, the cells are now perfect.

Thanks anyway, Dan

I have found a solution for all my CSS issues: getting a smoke and then trying again... ;-)
 
Hi,

Well, on my IE6, collapse does the trick....

However, you can define borders on leftmost cell(s) and (one) right most cell. That should take care of your problem:

Code:
.tdCell-right {
    border              : 1px solid black;
    font-size           : 13px;
    color               : #000000;
    background-color    : #CDCDCD;
    font-family         : Arial, Helvetica, sans-serif;
    text-align          : justify;
    text-decoration     : none;
}

.tdCell-left {
    border-top          : 1px solid black;
    border-left         : 1px solid black;
    border-bottom       : 1px solid black;
    font-size           : 13px;
    color               : #000000;
    background-color    : #CDCDCD;
    font-family         : Arial, Helvetica, sans-serif;
    text-align          : justify;
    text-decoration     : none;
}

... then :

Code:
<TABLE STYLE="width: 390px;" CELLSPACING="0" CELLPADDING="0">
<TR>
    <TH CLASS="tdCell-left">&nbsp;Code</TH>
    <TH CLASS="tdCell-left">&nbsp;Anticorps contre</TH>
    <TH CLASS="tdCell-left">&nbsp;Ig-class</TH>
    <TH CLASS="tdCell-right">&nbsp;Substrate</TH>
</TR>
</TABLE>

Good luck!


Jakob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top