Re: More questions about a table
by "Donna M Smillie" <dms(at)zetnet.co.uk>
|
Date: |
Sun, 8 Aug 1999 10:40:48 +0100 |
To: |
<tjtmd(at)ibm.net>, <hwg-basics(at)mail.hwg.org> |
References: |
ibm |
|
todo: View
Thread,
Original
|
|
Hi again Tanya :-)
----- Original Message -----
From: Tanya <tjtmd(at)ibm.net>
> I hope these questions are appropriate for this list :)?
Yep - this is where we all come to ask about basic HTML coding - the "why",
"how" and "what" questions. :-)
> Don't the <TD> (or <TR>) ALIGN & VALIGN attributes take precedence over
> the <TR> ALIGN and VALIGN attributes? So could anyone PLEASE explain why
> the text uses the <TR VALIGN ALIGN> at all?
> <TABLE BORDER="2" CELLSPACING="3" CELLPADDING="0">
> <TR VALIGN="top" ALIGN="left">
> <TD WIDTH="248"><P ALIGN="center"><FONT SIZE="+2" FACE="arial black,
> helvetica black, lb helvetica black">Cars</FONT></TD>
> <TD WIDTH="243" HEIGHT="37"><P ALIGN="center"><FONT SIZE="+2"
> FACE="arial black, helvetica black, lb helvetica black"> Number
> Available</FONT></TD>
> </TR>
> <TR VALIGN="top" ALIGN="left">
> <TD WIDTH="248"><P><A HREF="ORDER">'55 Chevy Waver</A></TD>
> <TD WIDTH="243" HEIGHT="21"><P>2</TD>
> </TR>
[snipped]
> </TABLE>
You're right that alignment attributes in individual cells should override
alignment attributes specified for the whole row. If you look at the
second row in the example, however, you'll see that no alignment is
specified in the TD tags, which means that by specifying the alignment
requirements just once, in the TR tag, you can specify the alignment for
all cells in that row, without having to put those attributes in every
single TD tag. That doesn't matter so much when you only have 2 columns,
as in this example, but if you imagine a table with 10 columns, this can
cut out a lot of extra code. Even if you wanted 8 of the cells in the row
to have the same alignment settings, with 2 of the cells set up
differently, you would still be cutting down on the amount of code you
would have to enter by setting up the "default" alignment for the row in
the TR tag, and then adding different alignment attributes in just those 2
cells that you want to set up differently.
Hope that answered your question OK?
Regards,
Donna
--
dms(at)zetnet.co.uk
Different Worlds: http://www.users.zetnet.co.uk/dms/
Pictures of the Past, The Leslie Smith Family,
An Introduction to HTML, Copyright Considerations
Calendar Wallpapers
HTML: hwg-basics mailing list archives,
maintained by Webmasters @ IWA