| Defining Table and Column Widths |
All the tables created rely on the browser
itself to decide how wide the table and column widths would
be. In this section you will learn how to have more control
over how wide your tables and columns are.
|
|
Setting Break in Text |
|
|
Table Widths |
|
|
Column Widths |
Line breaks are particularly useful if you
have a table in which most of the cells are small and only
one or two cells have longer data. As long as the screen width
can handle it, the browser generally just create long rows,
which looks rather odd in some table. By introducing line
breaks, you can wrap that row short.
Syntax:
Often the easiest way to make small changes
to how a table is laid out is by using line breaks (<BR>tags),
the NOWRAP attribute, or using both <BR> and NOWRAP together.
Assume you have a table in which a cell
is being wrapped, for which you want all the data on one line.
In this case, you can add the NOWRAP attribute to the <TH>
or <TD> tags, and the browser
keeps all the data in that cell on one line.
The WIDTH attribute to the <TABLE>
tag defines how wide the table will be opened on the page.
WIDTH can have a value that is either the exact width of the
table (in pixels) or a percentage of the current screen width,
which can therefore change if the window is resized. If the
width is specified, the width of the columns within the table
can be compressed or expanded to fit the required width.
Note: It is always
a better idea to, specify your table widths as percentages
rather than as specific pixel width. Because you do not know
how wide the browser window will be; using the percentage
allows your table to be reformatted to whatever width it is.
Using specific pixel widths might cause your table to run off the page.
The WIDTH attributes can also be used on
individual cells to indicate the width of individual columns.
As with the table width, the WIDTH tag in a cell can be an
exact pixel width or a percentage (which is taken as a percentage
of the full table width). As with table widths, using percentages
rather than specific pixel widths is a better idea because
it allows your table to be displayed regardless of the window size.

Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.
|
|
|