W3C home > Mailing lists > Public > www-validator@w3.org > April 2005

Re: how to center a table

From: David Dorward <david@dorward.me.uk>
Date: Thu, 21 Apr 2005 21:35:49 +0100
To: Fellowship Bible Church <fbchurch@gsinet.net>
Cc: www-validator@w3.org
Message-ID: <20050421203549.GA3960@us-lot.org>

On Thu, Apr 21, 2005 at 04:13:42PM -0400, Fellowship Bible Church wrote:
 
> I am using CSS and I would like to center a table.

http://dorward.me.uk/www/centre/#block

> I put <p class="center"> before my table and </p> after the closing
> table tag The validator didn't like this - it thought I was using a
> closing </p> tag for an element never opened.

In HTML, you can not place a table inside a paragraph, and end tags
are optional for paragraphs. So the start of the table implies the end
of the paragraph, so when you try to close it after the table there is
no longer an open paragraph to close.

-- 
David Dorward                                      http://dorward.me.uk
Received on Thursday, 21 April 2005 20:35:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:18 GMT