The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Internal table borders not displaying
Dusty2
post Sep 20 2020, 06:51 AM
Post #1





Group: Members
Posts: 2
Joined: 20-September 20
Member No.: 27,546



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 20 2020, 07:34 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,586
Joined: 10-August 06
Member No.: 7



Here:

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

The above removed borders from table.PN th and any TD element.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dusty2
post Sep 20 2020, 11:00 AM
Post #3





Group: Members
Posts: 2
Joined: 20-September 20
Member No.: 27,546



Ah, didn't realise that the command applied in that way. Many tnks, I can deal with it now I understand it!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th October 2020 - 05:50 PM