<table
width="pixels or percentage" |
Where to position your table |
width
attribute to the table
element to explicitly set the width of your table. Also, providing the table does not fill or exceed the width of the available space (e.g. your web page), you can use the align
attribute to set its alignment. These attributes are detailed below:
width="percentage or pixels"
~ Using the width
attribute, you can explicitly set the width of your table. You may define either a fixed width in pixels or a relative width which will size your table according to a percentage of the available space (typically the entire width of your web page). width="900"
attribute-value pair thus displaying it 900 pixels wide will outsize all screens using a resolution of 800 x 600. This will necessitate the insertion of horizontal scroll bars at the bottom of the user's web browser and may create an unattractive display. width
attribute, web browsers will automatically resize your table according to available screen space defined by the user's screen resolution. Thus a width="50%"
attribute-value pair will display a table at approximately 400 pixels in width on 800 x 600 screen resolution while displaying a table approximately 512 pixels in width on 1024 x 768 screen resolution. Using percentages creates what is known as a 'liquid' display which accomodates itself to all screen resolutions.align="left, center or right"
~ Assuming that your table does not fill or exceed all the available space on your web page (see above), you can use the align
attribute to position it to the left
, in the center
or to the right
on your web page. When aligning a table to the left or right, the block element containing the table will wrap text around it accordingly (please see Aligning Graphics for a complete discussion on how text flows around elements using the align
attribute).<table border="5" width="50%" align="right">
<tr><td>Cell content... </td></tr>
</table>
Cell content... |
<table border="5" width="300" align="center">
<tr><td>Cell content... </td></tr>
</table>
Cell content... |
Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates
See also:
If you need a .COM web address, you can get one quick and easy at...
<~BACK | TOP | NEXT~> |