Rule Definition
Presentational attributes mix style with structure and are deprecated.
Remediation
Move styling to CSS classes.
Violation Code Sample
<table bgcolor="#ffffff" border="1">
<tr>
<td align="center" valign="top" nowrap>Content</td>
</tr>
</table>
Fixed Code Sample
<table class="table-default">
<tr>
<td class="cell-centered no-wrap">Content</td>
</tr>
</table>
# CSS
.table-default {
background-color: #ffffff;
border: 1px solid #000;
border-collapse: collapse;
}
.cell-centered {
text-align: center;
vertical-align: top;
}
.no-wrap {
white-space: nowrap;
}
Reference
MDN – Obsolete and deprecated HTML attributes:
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
WHATWG HTML Living Standard – Obsolete attributes:
https://html.spec.whatwg.org/multipage/obsolete.html
W3C – Separation of structure and presentation (HTML vs CSS):
https://www.w3.org/Style/CSS/Overview.en.html
Related Technologies
Technical Criterion
CWE-710 - Improper Adherence to Coding Standards [Pillar]
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.