Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ Internal table borders not displaying

Posted by: Dusty2 Sep 20 2020, 06:51 AM

Hi - still getting to grips with html and css, so I hope someone can give me a pointer. I have a page with two tables. The second works fine, and displays no borders, external or internal, as required. The first displays the border around the table but no border around the individual cells, which is required. I have used exactly the same code on a different page which works as it should. No matter how much I stare at it, I cannot see where the problem lies. Here is the code from the two table declarations to the first line of the first table. I cannot see anything that would contradict the declarations in the second section of table.register.

table.register {
border-collapse:collapse;
border:2px solid black;
width: 58%;
margin-right:21%;
margin-left:21%;
}

table.register th, td {
border-collapse: collapse;
border: 1px solid black;
}

table.register td {font-weight:bold;}
table.register td +td {font-weight:normal;}

table.PN {
border-collapse:collapse;
border:none;
width:58%;
margin-right:21%;
margin-left:21%;
}

table.PN th, td {
border-collapse:collapse;
border:none;
}

table.PN th {text-align:left;}
table.PN th +th {text-align:right}

</style>

</head>


<body bgcolor="#ffffff">
<p style="font-family: Georgia, Garamond, serif"> </p>

<h2 style="text-align: center"><span style="color: #008000">Saltley Reformatory Inmates</span></h2>

<hr align="center" size="3" width="47%" />

<h1 style="text-align: center"><span style="color: #0000cd">Samuel Hayward</span></h1>

<p><a href="SR_Index.htm"><strong><span style="color: #800080">[Return to Index]</span></strong></a></p>

<table class="register">
<tbody>
<tr>
<td>No. in Admissions Register:</td>
<td>271</td>
</tr>

Any help gratefully accepted, thanks

Posted by: Christian J Sep 20 2020, 07:34 AM

Here:

CODE
table.PN th, td {
border-collapse:collapse;
border:none;
}

The above removed borders from table.PN th and any TD element.

Posted by: Dusty2 Sep 20 2020, 11:00 AM

Ah, didn't realise that the command applied in that way. Many tnks, I can deal with it now I understand it!

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)