HTML Page Layouts: HTML Layout - Using Tables
HTML Page Layouts: HTML Layout - Using Tables
Web page layout is very important to give better look to your website. You should design your
webpage layout very carefully.
You may have noticed that there are many websites which have put their content in multiple
columns - they are formatted like a magazine or newspaper. This is easily achieved by using
tables or division or span tags. Sometime you use CSS as well to position various elements or to
create backgrounds or colorful look for the pages.
Although we can achieve pretty nice layouts with HTML tables, tables weren't really designed as
a layout tool. Tables are more suited to presenting tabular data.
You can achieve same result whatever you have achieved using
<table> tag in previous example.
<div style="width:100%">
<div style="background-color:#CC99FF;">
<b style="font-size:150%">This is Web Page Main title</b>
</div>
<div style="background-color:#FFCCFF;
height:200px;width:100px;float:left;">
<b>Main Menu</b><br />
HTML<br />
PHP<br />
PERL...
</div>
<div style="background-color:#eeeeee;
height:200px;width:300px;float:left;">
Technical and Managerial Tutorials
</div>
<div style="background-color:#CC99FF;clear:both">
<center>
Copyright © 2007 Tutorialspoint.com
</center>
</div>
</div>
This will produce following result:
Better layout can be created by using DIV, SPAN and CSS. For more information on CSS, please
refer CSS Tutorial.