You are on page 1of 10

TABLE

Tables are made up of rows and columns The number of cells in each row determines the tables shape To create simple table:
<table> <tr> to define the beginning of the first row <td> to define the beginning of the cell then type the content of the cell

Create a simple table


<table> <!-- photo --> <tr> <td> <img src="pocoyo.jpg" width="200" height="150"/> </td> </tr> </table>

2 rows, each with one cell, by default left

<table> <!-- photo --> <tr> <td> <img src="pocoyo.jpg" width="200" height="150"/> </td> </tr> <!-- caption --> <tr> <td class=caption> <p>pocoyo in the space - pocoyo in the space </p> </td> </tr> </table>

Adding border .css


table { border-size:10px; border-style:double; border-color:navy; }

.caption

{ font-style:italic; font-weight:bold; font-family:Verdana; color:blue; font-size:20px; }

Setting the width


<table width="200"> <!-- photo --> <tr> <td> <img src="pocoyo.jpg" width="200" height="150"/> </td> </tr> <!-- caption --> <tr> <td class="caption"> <p>pocoyo in the space - pocoyo in the space </p> </td> </tr> </table>

Centering a table on the Page

<table width="200" class="rightsidebar" align="center">

.rightsidebar

{ width:200px; margin-left:auto; margin-right:auto; }

Wrapping text around a table

You might also like