Tables
They are used to organize information and set layout of the web page. A cell is basic unit of a table that hold data.
Syntax: <Table cellpadding="1" cellspacing ="1" border=1 width="400px" height=""><caption>My table</caption><thead><tr ><th width=40%></th><th width=60%></th></tr></thead><tbody><tr><td></td><td></td></tr> <tr><td></td><td></td></tr> </tbody></table>
This will display a table with two rows and a column heading.
Table attributes cellpading/cellspacing value any no pixels cellpadding spacifies padding of the cell and its contents while cell spacing, the spacing between two cells.Caption is the general heading of the table <thead> is the grouping tag of the table that says the data in the enclosing row is of the type column heading. tbody says the data in the enclosing rows
is of type general table data. <TR> is the tag that defines Rows <TD> tag that defines a cell in which data is added.<TH> containe the column heading
All the general attributes like background, bgcolor height width style class id name are applicable to all <TABLE>,<TH><TD>
Learn by doing - Table
List
Another way of classifing data. Types of List ordered list unorderlist and definition list
Ordered list
Example Syntax<OL><li>Sam</li><li>John</li></OL>
datas will be displayed ordered with numbering.
UnOrdered list
Example Syntax<UL><li>Sam</li><li>Sam</li></UL>
Same as above but displayed with bullets instead of numbers.
There is yet another list called definition list used to define terms or topics
Example Syntax <dl><dt>Key board</dt><dd>An input device for the computer</dd> <dt>Monitor</dt><dd> an output device for the computer</dd> </dd>
Learn by doing - List
vivarem learn by doing more advanced html tutorial with online practice |