HTML Tables

 
<html>
	<head>
		<title>Table Tag</title>
	</head>
	<body>
		<table border="1" align="center" width="80%" cellpadding="10px" cellspacing="10px">
			<tr align="right">
				<td valign="top">Nunc et eros mi. Nam purus diam</td>
				<td>Sed non massa nec augue viverra blandit sed ac mauris. Aliquam pellentesque pulvinar quam</td>
			</tr>
			<tr>
				<td height="400px" valign="top" align="right">magna porttitor sed. Vivamus condimentum </td>
				<td>Ut lobortis quis lacus vel viverra. Nullam tempor ligula at urna condimentum ultrices. Ut sodales ornare faucibus. Ut augue neque, interdum sit amet efficitur euismod</td>
			</tr>
		</table>
	</body>
</html>
 
 

Table with Colspan

<html>
	<head>
		<title>Colspan</title>
	</head>
	<body>
		<table border="1" align="center" width="50%" cellpadding="10px" cellspacing="0px">
			<tr>
				<td height="100px">A</td>
				<td>B</td>
			</tr>
			<tr>
				<td height="100px" colspan="2">C</td>
			</tr>
			<tr>
				<td height="100px">E</td>
				<td>F</td>
			</tr>
		</table>
	</body>
</html>


Table with rowspan

<html>
	<head>
		<title>Rowspan</title>
	</head>
	<body>
		<table border="1" align="center" width="50%" cellpadding="10px" cellspacing="0px">
			<tr>
				<td height="100px">A</td>
				<td>B</td>
			</tr>
			<tr>
				<td height="100px" rowspan="2">C</td>
				<td>D</td>
			</tr>
			<tr>
				<td height="100px">F</td>
			</tr>
		</table>
	</body>
</html>


Table with caption tag

<html>
	<head>
		<title>Table with caption</title>
	</head>
	<body>
		<table border="1" align="center" width="50%" cellpadding="10px" cellspacing="0px">
			<caption>Student Record</caption>
			<tr>
				<td height="100px">A</td>
				<td>B</td>
			</tr>
			<tr>
				<td height="100px">C</td>
				<td>D</td>
			</tr>
			<tr>
				<td height="100px">E</td>
				<td>F</td>
			</tr>
		</table>
	</body>
</html>
 
 

Table with thead,tbody and tfoot

<html>
	<head>
		<title>Table with caption</title>
	</head>
	<body>
		<table border="1" align="center" width="50%" cellpadding="10px" cellspacing="0px">
			<thead>
				<tr>
					<th>Subject</th>
					<th>Marks</th>
				</tr>
			</thead>
			<tbody bgcolor="tan">
				<tr>
					<td>Math</td>
					<td>80</td>
				</tr>
				<tr>
					<td>English</td>
					<td>70</td>
				</tr>
				<tr>
					<td>Science</td>
					<td>75</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td>Total Marks</td>
					<td>255</td>
				</tr>
			</tfoot>
		</table>
	</body>
</html>