JavaScript Reference/Javascript Properties/rowSpan

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

"rowSpan" Example

   <source lang="javascript">
   

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

   document.getElementById("myTableHeader").rowSpan = 2;

} function function2() {

   location.reload();

} </script>

Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6
Cell 7 Cell 8 Cell 9
Cell 10 Cell 11 Cell 12

<input type="button" value="Span(2) Cell 1" onClick="function1();"> <input type="button" value="Restore" onClick="function2();"> </body> </html>


     </source>
   
  


"rowSpan" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<td> <th> | +----------------+--------------------------------------------------------------+

     </source>
   
  


"rowSpan" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Specifies the number of table rows that the cell should span.

Syntax:

document.getElementById("elementID").rowSpan = value document.all.elementID.rowSpan = value // IE only


     </source>