px text in <td> width attribute invalid px text in <td> width attribute invalid
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

px text in <td> width attribute invalid

Started by kaptainkory, August 02, 2005, 03:26:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kaptainkory

It is invalid to use px in the width value for <td> tags:

BAD:

<td width="48px">

GOOD:

<td width="48">


Also, for <table> tags:

BAD:

<table cellspacing="48px" cellpadding="48px">

GOOD:

<table cellspacing="48" cellpadding="48">

In themes.inc.php, if you do a search, you'll find plenty of these that need changed.

Thanks.

donnoman

I think we discussed this at least once on the dev list, bottom line there was confusion between css, and based on the fact that the px's didn't trip the XHTML validator I left it alone.

I believe as you do that when used in the context of xhtml attributes there should be no size qualifier, only used when used with CSS presentational elements such as style="" or inside the stylesheet itself.

Looking at the XHTML 1.0 Transitional DTD confirms this


<!ENTITY % Length "CDATA">
   <!-- nn for pixels or nn% for percentage length -->

<!ELEMENT table
    (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
<!ELEMENT caption  %Inline;>
<!ELEMENT thead    (tr)+>
<!ELEMENT tfoot    (tr)+>
<!ELEMENT tbody    (tr)+>
<!ELEMENT colgroup (col)*>
<!ELEMENT col      EMPTY>
<!ELEMENT tr       (th|td)+>
<!ELEMENT th       %Flow;>
<!ELEMENT td       %Flow;>

<!ATTLIST table
 %attrs;
 summary     %Text;         #IMPLIED
 width       %Length;       #IMPLIED
 border      %Pixels;       #IMPLIED
 frame       %TFrame;       #IMPLIED
 rules       %TRules;       #IMPLIED
 cellspacing %Length;       #IMPLIED
 cellpadding %Length;       #IMPLIED
 align       %TAlign;       #IMPLIED
 bgcolor     %Color;        #IMPLIED
 >



I only had to update themes.inc.php and minibrowser.php. Committed.