Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
I think the idea of validation is all or nothing. Virtually all "presentation" attributes are depreciated in HTML5 over CSS styles, so the validation warning is correct. Also worth pointing out since it's not clear how you are using tables, tables should only be used for data where a tabular presentation makes sense, not as a shortcut to position elements. <div></div> and CSS positioning are preferred if you just need positioning. – Stephanie Jun 17 '12 at 6:45
Does @SuppressWarning work with Eclipse's web-validation? I'm sure there must be something equivalent. Or perhaps you could roll back the HTML version number in your <!DOC> tag. – rm-vanda Aug 4 '12 at 21:25
up vote 2 down vote accepted

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.)
share|improve this answer
To respect the idea of validation I really think your second solution is the best. If one still needs to use HTML4 one should declare this explicitly. Thanks for your answers (Brian too). – jan Oct 16 '12 at 8:14

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

share|improve this answer
I'm not seeing that icon in the "Problems" view for Eclipse Luna... And I was going to suggest adding any attributes for the validator to ignore to the "Ignore specified attribute names in validation" box at the top of Preferences -> Web -> Validation, but doing so has no effect for me... – Spencer Williams Dec 8 '14 at 21:06
In Juno, there is a triangle icon(view menu) near three circles, select that and use the Show menu to filter the errors and warning separately. – Lucky Jul 5 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .