RE: Error in validator

Peter Foti wrote:

> I am getting the error below in an XHTML strict document.  I don't
> understand this because isn't the <p> element a block-level element?

> Line 36, column 55: 
>      <p><table border="0" cellspacing="0" cellpadding="0">
                                                         ^
> Error: element "table" not allowed here; possible cause is an inline
> element containing a block-level element

<p> _is_ a block-level element, but not all block-level elements can contain
all other block-level elements.

From the DTD <http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>:

> <!ELEMENT p %Inline;>
> <!ATTLIST p
>   %attrs;
>   >

That means <p> can contain only inline elements; <table> is a block-level
element (like <p>).

Why would you _want_ to put a <table> in a <p>?

Thanasis Kinias
Information Dissemination Team, Information Technology
Arizona State University
Tempe, Ariz., U.S.A.

Qui nos rodunt confundantur
et cum iustis non scribantur.

Received on Tuesday, 13 March 2001 13:01:08 UTC