Tables

When building websites we often need to organise our content to make it easier for the user to view and there are numerous techniques for achieving this. Tables have been used for a number of years and it is good for you to understand how they work, and the following pages show you some different methods you might like to use.

Example of a table layout

Left column Middle column Right column
1st row    
2nd row    

The code below can still be used but there are much better methods which allow a website to be more responsive.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Table Example
</head>

<body>
	<table width="90%" border="1" cellspacing="0" cellpadding="1">
		<tr>
			<th scope="col">Left column
			<th scope="col">Middle column
			<th scope="col">Right column
		</tr>
		<tr>
			<td>1st row
			<td> 
			<td> 
		</tr>
		<tr>
			<td>2nd row
			<td> 
			<td> 
		</tr>
	</table>
</body>
</html>