78 lines
1.6 KiB
HTML
78 lines
1.6 KiB
HTML
<html>
|
|
<head>
|
|
<title>colSpan test</title>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function colSpanOne() {
|
|
var x=document.getElementById('myTable1').rows[0].cells
|
|
x[0].colSpan=""
|
|
x[1].colSpan="7"
|
|
}
|
|
|
|
function colSpanTwo() {
|
|
var x=document.getElementById('myTable2').rows[0].cells
|
|
x[0].colSpan="0"
|
|
x[1].colSpan="0"
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body onload = "colSpanOne(); colSpanTwo()">
|
|
<p>Tests: the colspan attribute<br>
|
|
</p>
|
|
<p>Conditions:<br>
|
|
The colSpan attribute specifies the number of columns spanned by the current cell. The default value of
|
|
this attribute is one ("1"). The value zero ("0") means that the cell spans all columns from the current
|
|
column to the last column of the column group (COLGROUP) in which the cell is defined.
|
|
</p>
|
|
<p>The first table tests the default value of one, and an input of 7, which is within the normal range of expect input.
|
|
The first column in the first row should span only column "one" and the second cell should span all of the other columns.
|
|
The second table tests the zero value. "Just A" should span "A" and "Just B" should span "B."
|
|
</p>
|
|
<hr>
|
|
|
|
<br>
|
|
<table id="myTable1" border="1">
|
|
<caption>Testing Default and Regular Input</caption>
|
|
<tr>
|
|
<td colspan="4">First</td>
|
|
<td colspan="4">All the Rest</td>
|
|
</tr>
|
|
<tr>
|
|
<td>one</td>
|
|
<td>two</td>
|
|
<td>three</td>
|
|
<td>four</td>
|
|
<td>five</td>
|
|
<td>six</td>
|
|
<td>seven</td>
|
|
<td>eight</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<table id="myTable2" border="1">
|
|
<caption>Testing Zero Special Case</caption>
|
|
<tr>
|
|
<td colspan="4">Just A</td>
|
|
<td colspan="4">Just B</td>
|
|
</tr>
|
|
<tr>
|
|
<td>A</td>
|
|
<td>B</td>
|
|
<td>C</td>
|
|
<td>D</td>
|
|
<td>E</td>
|
|
<td>F</td>
|
|
<td>G</td>
|
|
<td>H</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|