JavaScript DHTML/Table/Table Head — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 10:28, 26 мая 2010
Содержание
Create Table Head
<source lang="html4strict">
<html> <body> <script language="JavaScript"> function function1() {
var m = document.all.myT.createTFoot(); m.bgColor = "red";
} function function2() {
var n = document.all.myT.createTHead(); n.bgColor = "yellow";
} </script>
Cell 1 | Cell 2 |
---|---|
Cell 3 | Cell 4 |
<input type="button" value="Create tfoot" onclick="function1();"> <input type="button" value="Create thead" onclick="function2();"> </body> </html>
</source>
Delete Table Head Example
<source lang="html4strict">
<html> <body> <script language="JavaScript"> function function1() {
document.all.myTable.deleteTFoot();
} </script>
Row 1 | Cell 1 |
Row 2 | Cell 2 |
Row 3 | Cell 3 |
TFOOT | Cell 4 |
<input type="button" value="Remove TFOOT" onclick="function1();"> </body> </html>
</source>
Header scope
<source lang="html4strict">
<html> <body>
Row 1 | Cell | Cell | Cell | Cell info 1 | Cell |
---|
<script language="JavaScript">
document.all.myTableHeader.scope = "colgroup";
</script> <button onclick="alert("This cell provides header information for its col.");"> Cell info 1 </button> </body> </html>
</source>
"headers" Example
<source lang="html4strict">
<html> <body> <script> function function1() {
document.getElementById("td1").headers = "hdr1"; document.getElementById("td2").headers = "hdr2"; document.getElementById("td3").headers = "hdr3";
} </script>
Item Number | Item Name | Item Description |
---|---|---|
28030 | CD-ROM | Tutorial |
<input type="Button" id="b1" value="Turn Headers "on"" onClick="function1();"> </body> </html>
</source>
"tHead" Example
<source lang="html4strict">
<html> <body> <script language="JavaScript"> function function1() {
document.all.myTable.tHead.style.backgroundColor = "blue";
} function function2() {
document.all.myTable.tFoot.style.backgroundColor = "red";
} </script>
tHead, Cell 1 |
tBody, Cell 2 |
tBody, Cell 3 |
tBody, Cell 4 |
tFoot, Cell 5 |
<button onclick="function1();">Turn Head Blue</button> <button onclick="function2();">Turn Foot Red</button> </body> </html>
</source>