I have couple of <th>
elements within a <thead>
element. The first one or one of them is an empty th used as placeholder and does not contain any text.
Wave tool gives out an error that th cannot be empty and suggests I change to <td>
.
Now if I have a <td>
within a <thead>
it solves the issue and passes html validation too.
Is there any reason, I should not be having a <td>
within <thead>
From HTML view:
<td>
is allowed inside a <thead>
. Permitted content of a <thead>
are zero or more <tr>
elements. In a <tr>
element you can put a <td>
and/or <th>
element. It doesn’t matter.
From WCAG view:
A table can not have any empty table headers. This can be really confusing for screen reader users. There is one special case: Layout tables. Tables which are only used for "layouting", can have empty <td>
's as "column header". But if i understand your case correctly, you have some other regular table content, so you must add a column header for every column.
So in your case it is not ok to have an empty <td>
as column header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With