How to ignore Eclipse validation warning "Attribute (...) is obsolete. Its use is discouraged in HTML5 documents." in HTML and JSP fragments?

Create a html/jsp fragment in eclipse in a project where html/jsp validation is active and add

<table width="80%"></table>

You will get the warning in the question title.

One can configure the validation under Preferences -> Web -> [HTML|JSP] Files -> Validation, but no option there affects this warning.


Solution 1:

From the quoted error message, it seems like your HTML document is defined as HTML5. This latest standard has depreciated the width attribute of the the table tag, so today one is supposed to achieve the same via CSS :

<table style="width: 80%"></table>

Your best options are :

  1. Convert to the above latest syntax in order to avoid the warning
  2. Use a permissive Doctype Declaration, such as HTML 4.01 Transitional, to "legalize" the width attribute. (Not really recommended.)

Solution 2:

The problem view has extensive filtering capabilities. It's the enter image description here icon in the upper right of the view.