PDA

View Full Version : end tag for element "P" which is not open


linuxis
06-13-2006, 06:48 AM
I just run the w3c validator and it gives me 1 error, namely:
Line 50, column 3: end tag for element "P" which is not open.

I'm using this css:

p.leftmargin {margin-left: 1cm;}

and this html:

<p class="leftmargin">
<table>
blabla
</table>
</p>

Why am I getting this validation error ?

_Aerospace_Eng_
06-13-2006, 06:52 AM
The table is a block level element. Only inline elements like links or spans can go inside of a paragraph. Change your paragraph to a div, and use proper table tags, you know
<table>
<tr>
<td>blabla</td>
</tr>
</table>
Why don't you just apply the left margin to the table itself?
<table class="leftmargin">
then no need to have the extra markup surrounding it.

linuxis
06-13-2006, 07:36 AM
tnx aero !!