2024-04-18 11:38:03 +02:00
|
|
|
include::../why.adoc[]
|
2021-04-28 16:49:39 +02:00
|
|
|
|
2023-10-11 10:52:18 +02:00
|
|
|
This rule raises an issue whenever a `<table>` does not contain any `<th>` elements.
|
2021-04-28 16:49:39 +02:00
|
|
|
|
2024-04-18 11:38:03 +02:00
|
|
|
include::../exceptions.adoc[]
|
2021-04-28 16:49:39 +02:00
|
|
|
|
2024-04-18 11:38:03 +02:00
|
|
|
include::../how.adoc[]
|
2023-10-11 10:52:18 +02:00
|
|
|
|
|
|
|
=== Code examples
|
|
|
|
|
|
|
|
==== Noncompliant code example
|
|
|
|
|
|
|
|
[source,html,diff-id=1,diff-type=noncompliant]
|
2021-04-28 16:49:39 +02:00
|
|
|
----
|
|
|
|
<table> <!-- Noncompliant -->
|
|
|
|
<tr>
|
|
|
|
<td>Name</td>
|
|
|
|
<td>Age</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>John Doe</td>
|
|
|
|
<td>24</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Alice Doe</td>
|
|
|
|
<td>54</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
----
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2023-10-11 10:52:18 +02:00
|
|
|
==== Compliant solution
|
2021-04-28 16:49:39 +02:00
|
|
|
|
2023-10-11 10:52:18 +02:00
|
|
|
[source,html,diff-id=1,diff-type=compliant]
|
2021-04-28 16:49:39 +02:00
|
|
|
----
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">Name</th>
|
|
|
|
<th scope="col">Age</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>John Doe</td>
|
|
|
|
<td>24</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Alice Doe</td>
|
|
|
|
<td>54</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
----
|
|
|
|
|
2024-04-18 11:38:03 +02:00
|
|
|
include::../resources.adoc[]
|