JavaScript DHTML/Table/Column

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

"axis" Example: Group Column

   <source lang="html4strict">
   

<html> <body>

   </tr>
   </tr>
table caption
  cell 1 cell 2
name      
2004 7 2  
2004 9 1   2004 7 1  

<button onclick="alert(head1.axis);">Get the axis for heading 1</button> </body> </html>


     </source>
   
  


Column span Example

   <source lang="html4strict">
   

<html> <body>

<colgroup> <col id="col_1"> <col id="col_2"> <col id="col_3">
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6
Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6

<input type="button" value="Span" onClick="function1();"> <script language="JavaScript">

   document.getElementById("col_1").span = 2;
   document.getElementById("col_2").span = 3;
   document.getElementById("col_3").span = 1;
   function function1() {
       document.getElementById("col_2").align = "center"
       document.getElementById("col_2").style.color = "green"; 
   } 

</script>


     </source>