C & G web

Tables

Tables start with an optional caption followed by one or more rows. Each row consists of one or more cells, which can be either header or data cells. Cells can overlap across rows and columns.

The ALIGN attribute controls the alignment of the table itself, but not of the individual cells. This can be set either in the TR element for an entire row, or in the TD and TH elements for individual cells. The WIDTH attribute can be a pixel width or a percentage. It indicates the suggested width of the table, although the browser can ignore this if it is not possible. A "100%" value means the table will span across the entire browser window.

You can specify the width of the border around the table with the BORDER attribute. This attribute only affects the width of that border, not of the lines between table cells. If the attribute is omitted, no border will be drawn.


Example - Tables

Tables

1 2 3
4 5 6
7 8 9

The HTML

<html>

<head>
	<title>Tables</title>
</head>

<body bgcolor="Olive">

<h2>Tables</h2>

	<table>		<!-- start a new table -->
			
		<tr>	<!-- start a new table row -->
		
			<td>1</td>	<!-- add some table data -->
			<td>2</td>
			<td>3</td>
		</tr>
		
		<tr>
			<td>4</td>
			<td>5</td>
			<td>6</td>
		</tr>
		
		<tr>
			<td>7</td>
			<td>8</td>
			<td>9</td>
		</tr>
	</table>

</body>

</html>	
		

Previous page...

>>> More...

Back to Top of Page

Computeach International Ltd

Christopher Ward London Limited

Christopher Ward London Limited