Consider using the "width" attribute with the tabl

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Consider using the "width" attribute with the tabl

Post by RSteinwand »

Hi Albert.

As I'm re-validating my web site, I'm seeing this message for this line:
<table border="0" cellpadding="5" cellspacing="0" style="width:100%">

As you can see, I have a width declared. Is there a significance between the width in the table, vs the width in a style statement?
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Post by Albert Wiersch »

Hello,

I haven't researched this but I suspect there's not any significant difference, at least any that I am currently aware of.

The "width" attribute should be fine since it is not deprecated in HTML 4.01.

It is possible that the CSS allows for more ways in which to specify the width (more units).
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Dwight_Stegall
Rank 0 - Newcomer
Posts: 6
Joined: Thu Jan 15, 2009 7:52 pm
Location: East Moline, Illinois

Post by Dwight_Stegall »

i suggest you put summary="description of this table goes here" in the table tag if you want it to validate.
User avatar
CaryD
Rank II - Novice
Posts: 46
Joined: Sun Oct 01, 2006 2:18 pm
Location: CA

Post by CaryD »

The summary attribute can help with accessibility, but it's not necessary for validating.