banner

Table attribute?


    Here is some table attribute is given with example.

1- align ( left, center, right )
2- valign ( top, middle, bottom, baseline )
3- border
4- bgcolor ( set backgound color)
5- background-image
6- table width and height

Example:-

<html>
<body>

<table width="600" height="150" border="2" align="center">
<tr>
<td>align="left"</td>
<td align="center">align="center"</td>
<td align="right">align="right"</td>
</tr>

<tr>
<td>valign="top"</td>
<td valign="middle">valign="middle"</td>
<td align="center" valign="bottom">align"bottom"</td>
</tr></table>


</body>
</html> 


Output of above example:-
align="left" align="center" align="right"
valign="top" valign="middle" align"bottom"

Example:-

<html>
<body>

<table border="2"><tr><td background="portrait.jpg">row1,coloumn1</td><td bgcolor="#CCFF99">row1, coloumn2 </td>
</tr>
<tr><td>row2,coloumn1</td><td>row2, coloumn2</td></tr>
</table>

</body>
</html> Output of above example:-

row1,coloumn1row1, coloumn2
row2,coloumn1row2, coloumn2


     Write above code on notepad and save it with table.html name and open it. Page is given below:-