![github-actions[bot]](/assets/img/avatar_default.png)
* Add javascript to rule S5256 * [JS-3] Add Rspec --------- Co-authored-by: zglicz <zglicz@users.noreply.github.com> Co-authored-by: Michal Zgliczynski <michal.zgliczynski@sonarsource.com>
52 lines
820 B
Plaintext
52 lines
820 B
Plaintext
include::../why.adoc[]
|
|
|
|
This rule raises an issue whenever it detects a table that does not have a full row or column with `<th>` elements.
|
|
|
|
include::../exceptions.adoc[]
|
|
|
|
include::../how.adoc[]
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,javascript,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
<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>
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,javascript,diff-id=1,diff-type=compliant]
|
|
----
|
|
<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>
|
|
----
|
|
|
|
include::../resources.adoc[]
|