Consider using the "width" attribute with the tabl

Discussion about HTML and XHTML related issues.
Post Reply
User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 600
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Consider using the "width" attribute with the tabl

Post by RSteinwand » Fri Nov 07, 2008 2:47 pm

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
Site Admin
Posts: 3407
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch » Fri Nov 07, 2008 5:43 pm

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).
Image
Albert Wiersch

Dwight_Stegall
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 6
Joined: Thu Jan 15, 2009 7:52 pm
Location: East Moline, Illinois
Contact:

Post by Dwight_Stegall » Fri Jan 16, 2009 9:26 am

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
Rank II - Novice
Posts: 46
Joined: Sun Oct 01, 2006 2:18 pm
Location: CA

Post by CaryD » Sat Jan 17, 2009 8:35 pm

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

Post Reply