References

Collection of references for web development.

HTML td tag

Description

The HTML <td> element represents a table cell.

Attributes

Attribute Value Description
colspan number Specifies the amount of columns the cell extends.
headers id_list Specifies the headers that the element relates to.
rowspan number Specifies the amount of rows the cell extends.

Example

<table>
	<thead>
		<tr>
			<td>Name</td>
			<td>Gender</td>
			<td>Age</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>David</td>
			<td>Male</td>
			<td>23</td>
		</tr>
		<tr>
			<td>Jessica</td>
			<td>Female</td>
			<td>47</td>
		</tr>
		<tr>
			<td>Warren</td>
			<td>Male</td>
			<td>12</td>
		</tr>
	</tbody>
</table>

Example #2

<style>
table {
    border-collapse: collapse;
}
td {
	border:1px solid black;
	padding:5px;
}
thead {
	font-weight:bold;
}
</style>
<table>
	<thead>
		<tr>
			<td>Name</td>
			<td>Gender</td>
			<td>Age</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>David</td>
			<td>Male</td>
			<td>23</td>
		</tr>
		<tr>
			<td>Jessica</td>
			<td>Female</td>
			<td>47</td>
		</tr>
		<tr>
			<td>Warren</td>
			<td>Male</td>
			<td>12</td>
		</tr>
	</tbody>
</table>