Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
4  
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

2 Answers 2

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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.