Tuesday, 3 February 2015

Fundamentals
A table is simple words is a grid of one or more rows and columns. At the intersection of each row and column is a cell. Table cells can hold HTML content such as text, hyperlinks or images. One row can be tall, the other short. One column will be wide, the other narrow. As you manipulate the table rows and columns, the content of the cells will move along too. As a result, you can use tables to create essentially any arrangement of elements on your page.

Basic Tags of Table
A table required at least three HTML tags:
  • The <table> tag defines the table.
  • Within the <table> tag there will be one <tr> tag for each row.
  • Within each <tr> tag there will be one <td> tag for each column.
  • Within each <td> tag you place the content for that cell.

The following HTML creates a basic table with two rows and three columns; the resulting table is shown in next figure. Note that we have included the border attribute, which will be covered later in the chapter. You can skip this but then table would be displayed without borders.

<body>
<table border='2'>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
<td>row 1, cell 3</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
<td>row 2, cell 3</td>
</tr>
</table>
</body>


Out Put

0 comments:

Post a Comment