HTML Table

Attribute of Tr

S.No. Att. Name Description Value
1 Align Text Align Left, Right, Center, Justify
2 Valign Vertical Text Align Top, Bottom
3 Height Height of Row In Number
4 bgcolor Background color of row Any color name or code
Example (Height of row)
S.No. Name Marks
1 Ram 78
2 Pop 85
3 Jack 75
<table border=5 bordercolor='red' cellpadding=10 cellspacing=10 bgcolor='yellow'>
	<tr bgcolor='#09FFFF'>		<td>S.No.		<td>Name		<td>Marks	</tr>
	<tr height='80'>		<td>1			<td>Ram			<td>78	</tr>
	<tr align='right'>		<td>2(right)			<td>Pop			<td>85	</tr>
	<tr height='80' valign='top'>		<td>3			<td>Jack(top)		<td>75	</tr>
</table>

Example (Background COlor of row)
S.No. Name Marks
1 Ram 78
2 Pop 85
3 Jack 75
<table border=5 width=200 height=200 bordercolor='red'>
	<tr bgcolor='#ff7733'>		<td>S.No.		<td>Name		<td>Marks	</tr>
	<tr bgcolor='#66ffcc'>		<td>1			<td>Ram			<td>78	</tr>
	<tr bgcolor='#ccff33'>		<td>2			<td>Pop			<td>85	</tr>
	<tr bgcolor='#4dff4d'>		<td>3			<td>Jack		<td>75	</tr>
</table>

Example (Text Align of row)
1 Ram 78
2 Pop 85
3 Jack 75
<table border=5 width=200 height=200 bordercolor='red'>
	<tr align='left'>		<td>1			<td>Ram			<td>78	</tr>
	<tr align='center'>		<td>2			<td>Pop			<td>85	</tr>
	<tr align='right'>		<td>3			<td>Jack		<td>75	</tr>
</table>
Example (Vertical Align of row)
1 Ram 78
2 Pop 85
3 Jack 75
<table border=5 width=200 height=200 bordercolor='red'>
	<tr valign='top'>		<td>1			<td>Ram			<td>78	</tr>
	<tr valign='middle'>		<td>2			<td>Pop			<td>85	</tr>
	<tr valign='bottom'>		<td>3			<td>Jack		<td>75	</tr>
</table>

Attribute of Th, Td

S.No. Att. Name Description Value
1 Height Height of cell In pixels or percentage
1 Weight Weight of cell In pixels or percentage
2 Align Particular cell text align Left, Right, Center, Justify
2 Valign Particular cell vertical align Top, Bottom
3 Colspan For merge columns In Number
3 Rowspan For merge rows In Number
1 bgcolor For particular cell background color Any color name or code
Example (Width of columns)
S.No. Name Marks
1 Ram 78
2 Pop 85
3 Jack 75
<table border=3 bordercolor='red'>
	<tr>		<td width=80>S.No.		<td width=100>Name		<td width=120>Marks	</tr>
	<tr>		<td>1			<td>Ram			<td>78	</tr>
	<tr>		<td >2			<td>Pop			<td>85	</tr>
	<tr>		<td>3			<td>Jack		<td>75	</tr>
</table>

Example (Height of columns)
S.No. Name Marks
1 Ram 78
<<table border=3 bordercolor='red'>
	<tr>		<td height=50>S.No.		<td>Name		<td>Marks	</tr>
	<tr>		<td height=60>1			<td>Ram			<td>78	</tr>
	
</table>


Example (Vertical Align of cell)
Top. Middle Bottom
1 Ram 78
<table border=3 width=200 height=150>
	<tr>		<td valign='top'>Top.		<td valign='middle'>Middle		<td valign='bottom'>Bottom	</tr>
	<tr>		<td>1			<td>Ram			<td>78	</tr>
</table>
Example (Background of cell)
Color Color Color
1 Ram 78
<table border=3 width=200 height=150>
	<tr>		<td bgcolor='#ccff33'>Color		<td bgcolor='#cc66ff'>Color		<td bgcolor='#809fff'>Color	</tr>
	<tr>		<td bgcolor='#ffcc00'>1			<td bgcolor='#ff7733'>Ram			<td bgcolor='#99ff33'>78	</tr>
</table>