Sunday, 2 December 2012

Re: Alignment in table cells

In message <682ee8f752.harriet@blueyonder.co.uk>
Harriet Bazley <lists@orange.wingsandbeaks.org.uk> wrote:

> I'm having weird issues with table cell right-alignment in the second
> row of a table.

> Given the following cut-down table

> <TABLE WIDTH="100%" BORDER="1">
> <TR>
> <TD ALIGN="LEFT" WIDTH="20%">left align</TD>
> <TD ALIGN="CENTER">
> center align</TD>
> <TD ALIGN="RIGHT"WIDTH="20%">
> right align</TD>
> </TR>
> <TR>
> <TD ALIGN="LEFT" WIDTH="50%">left align</TD>
> <TD align="right"WIDTH="50%">right align</TD>

Have you tried inserting "SPAN=2" after the TD in the line above?

> </TR>
> </TABLE>


> I find that the right-aligned data in the second row is apparently
> centre-aligned: adding visible borders indicates that (despite the
> explicit width definitions in these cells) the cells in the second row
> are being created with the same width as the corresponding cells in the
> first row, in other words, there is a blank space to the right of the
> row corresponding to the 'missing' third cell.

> This code used to display as expected on Netsurf 2.9 - am I abusing HTML
> here? Is it no longer legal to have differing numbers of cells, or
> cells of differing widths, per row in an HTML table?

Chris

--

Chris Shepheard writing as himself
chris.shepheard@chrispics.co.uk
from far west Surrey www.chrispics.co.uk

No comments:

Post a Comment