JavaScript DHTML/Table/Table Foot

Материал из Web эксперт
Перейти к: навигация, поиск

Create Table Foot

   <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>

<thead id="th"> <tfoot id="tf">
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 Foot

   <source lang="html4strict">
   

<html> <body> <script language="JavaScript"> function function1() {

   document.all.myTable.deleteTFoot();

} </script>

<tfoot> </tfoot>
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>
   
  


"tFoot" 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> </thead> <tbody> </tbody> <tfoot> </tfoot>
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>