Re: 3.2 tables and the width attribute

Charles Peyton Taylor <CTaylor@wposmtp.nps.navy.mil> writes:
>I remember some discussion about the percent symbol
>screwing things up in SMGL, but I notice that in
>the HTML 3.2 overview Width="80%" is used.  It makes
>sense that the percent symbol is okay within
>quotation marks, but other values for attributes
>can often drop the quotation marks.
>
>IE:
><img height=10 width=20 >
>or
><img height="10" width="20" >
>
>so, is the rule that if you use the percent symbol
>in the value of the width attribute of the table
>element, you must enclose the value in quotation marks?
>
>IE:
><table Width="100%"> </table>
>but not
><table Width=100%> </table>

SGML attribute values are CDATA that can be dealt with in two ways:

   1. When entered as "attribute value literals", the
      attribute is enclosed in either single or double
      quotes. The only restriction here is that the
      quoting delimiter not appear within the literal,
      and that the attribute content is valid character data.

   2. When literal delimiters (single or double quotes)
      are missing, the attribute content must be a valid
      SGML NAME. NAMEs are defined as containing only
      alphanumeric characters, with no spaces. The SGML
      declaration for HTML (under the section NAMING)
      additionally defines LCNMCHAR and UCNMCHAR (upper
      and lowercase naming characters) as allowing
      periods or hyphens. No characters other than
      alphanumeric, hyphen and period are allowed in
      unquoted attribute literals. NAMELEN (name length)
      is currently set by the SGML declaration at 72
      characters. There has been talk of increasing this
      value, but for the purposes of unquoted literals,
      this isn't particularly necessary (not too many
      words are more than 72 characters...)

Given that a percent sign or a space are not allowed in an SGML NAME,
attribute values containing them must _always_ be quoted.

Murray

```````````````````````````````````````````````````````````````````````````````
     Murray Altheim, Program Manager
     Spyglass, Inc., Cambridge, Massachusetts
     email: <mailto:murray@spyglass.com>
     http:  <http://www.stonehand.com/murray/murray.html>
            "Give a monkey the tools and he'll eventually build a typewriter."

Received on Friday, 10 May 1996 15:14:23 UTC