HTML DOM createTHead() ·½·¨
¶¨ÒåºÍÓ÷¨
createTHead() ·½·¨ÓÃÓÚÔÚ±í¸ñÖлñÈ¡»ò´´½¨ <thead> ÔªËØ¡£
Óï·¨
tableObject.createTHead()
·µ»ØÖµ
·µ»ØÒ»¸ö TableSection£¬±íʾ¸Ã±íµÄ <thead> ÔªËØ¡£Èç¹û¸Ã±í¸ñÒѾÓÐÁ˱íÍ·£¬Ôò·µ»ØËü¡£Èç¹û¸Ã±íûÓбíÍ·£¬Ôò´´½¨Ò»¸öÐÂµÄ¿Õ <thead> ÔªËØ£¬°ÑËü²åÈë±í¸ñ£¬²¢·µ»ØËü¡£
ʵÀý
ÏÂÃæµÄÀý×ÓΪ±í¸ñ´´½¨ÁËÒ»¸ö½Å×¢£º
<html>
<head>
<script type="text/javascript">
function createCaption()
{
var x=document.getElementById('myTable').createTHead()
x.innerHTML="My table head"
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>Row1 cell1</td>
<td>Row1 cell2</td>
</tr>
<tr>
<td>Row2 cell1</td>
<td>Row2 cell2</td>
</tr>
</table>
<br />
<input type="button" onclick="createCaption()"
value="Create caption">
</body>
</html>