W3C home > Mailing lists > Public > www-amaya@w3.org > July to September 2001

RE: DIVS AND TABLES

From: Dave J Woolley <david.woolley@bts.co.uk>
Date: Mon, 16 Jul 2001 19:51:39 +0100
Message-ID: <81E4A2BC03CED111845100104B62AFB50102A831@stagecoach.bts.co.uk>
To: www-amaya@w3.org
> From:	John Russell [SMTP:ve3ll@rac.ca]
> 
> I have a div element with text-align:center property
> if i place a paragraph inside this element,  it  is correctly centered
> if i place a table inside the element, it is not centered in Amaya
	[DJW:]  
	Examples needed.

	Inheritance into tables is broken in most browsers.

	text-align does not centre tables, only the inline content of
	block elements.  (I think the text within the table cells should 
	centre within the cells, but the table itself should default align,
	which is, I think, left.)  (All bets are off if you styled the 
	table as display: inline-table.)

	To centre a table, you should use auto left and right margins.
	<CENTER> has a lot to answer for, it tends to do a mix of both
	text align and margins.

	(Note that the paragraph doesn't centre, but takes up the full
	width, as ought to show if you colour it.)

	There is, however, a problem in Amaya 5.0 NT:

	<div style="text-align: center">
	<table style="width:30em; background-color: yellow">
	<tr>
	<td>xxxx</td>
	</tr>
	</table>
	</div>

	fails to action the width propery, and if you use the 
	deprecated method for setting the width, the cell content is
	not centred.

	Mozilla 0.9.2 appears to work.

	IE 5.01 gets it wrong (it centres the table instead of the cell
	contents.

	NS 4.75 gets it wrong (it centres the table and ignores the width;
	with the deprecated, width, attribute, it seems to make the same
	mistake as IE).

	Web TV Viewer 2.0 gets it wrong (both table and text are centred, 
	and the deprecated width attribute is needed).

>  
Received on Monday, 16 July 2001 14:52:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:53:24 UTC