JavaScript Reference/Javascript Properties/cellPadding — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
"cellPadding" Example
<html>
<body>
Click in any cell to view the cellIndex value.
<table id="myTable" cols="3">
<tr>
<th id="th1" onclick="function1(this);">Header 1</th>
<th id="th2" onclick="function1(this);">Header 2</th>
<th id="th3" onclick="function1(this);">Header 3</th>
</tr>
<tr>
<td id="td1" onclick="function1(this);">Cell 1</td>
<td id="td2" onclick="function1(this);">Cell 2</td>
<td id="td3" onclick="function1(this);">Cell 3</td>
</tr>
</table>
<br>
<button onclick="alert(myTable.cellPadding);">Cell Padding</button>
</body>
</html>
"cellPadding" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<table> |
+----------------+--------------------------------------------------------------+
"cellPadding" Syntax and Note
Note:
Read and write property.
Sets the padding between the cell border and its content.
Value:
An integer the amount of padding in pixels
integer% the percent of space between the cell wall and its content.
Syntax:
document.getElementById("tableID").cellPadding = value
document.all.tableID.cellPadding = value // IE only