Full width home advertisement

How To

Science

Post Page Advertisement [Top]


Colspan and Rowspan Attributes

Colspan attribute is used to merge two or more columns together into a single column. 

Rowspan attribute is used to merge two or more rows together into a single row.

Example

<!DOCTYPE html>

<html>

<head>

<title>Scholars Colspan or Rowspan Test</title>

</head>

<body>

<table border="1" cellpadding="5" cellspacing="5">

<tr>

<th>Column 1</th>

<th>Column 2</th>

<th>Column 3</th>

</tr>

<tr>

<td rowspan="2">Row 1 Cell 1</td>

<td>Row 1 Cell 2</td>

<td>Row 1 Cell 3</td>

</tr>

<tr>

<td>Row 2 Cell 2</td>

<td>Row 2 Cell 3</td>

</tr>

<tr>

<td colspan="3">Row 3 Cell 1</td>

</tr>

</table>

</body>

</html>

See Result:

Column 1
Column 2
Column 3
Row 1 Cell 1
Row 1 Cell 2
Row 1 Cell 3
Row 2 Cell 2
Row 2 Cell 3
Row 3 Cell 1

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib