JavaScript Reference/Javascript Properties/cellSpacing

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

"cellSpacing" Example

   <source lang="javascript">
   

<html> <body> Click in any cell to view the cellIndex value.

Header 1 Header 2 Header 3
Cell 1 Cell 2 Cell 3


<button onclick="alert(myTable.cellPadding);">Cell Padding</button> <button onclick="alert(myTable.cellSpacing);">Cell Spacing</button> <button onclick="alert(myTable.cols);">cols</button> <script language="JavaScript">

   function function1(elem) {
       alert("Cell Index :"+ elem.cellIndex);
   }

</script> </body> </html>


     </source>
   
  


"cellSpacing" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+

| Applied_To | | +----------------+--------------------------------------------------------------+ </source>

"cellSpacing" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Set the space between adjacent cells. Value: An integer the amount of padding in pixels integer% the percent of space between the cell

                  wall plus padding and its content
   

Syntax:

document.getElementById("tableID").cellSpacing = value document.all.tableID.cellSpacing = value // IE only


</source>