ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: HTML DOM cells ¼¯ºÏ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

HTML DOM cells ¼¯ºÏ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:1724 :: ::

Definition and Usage
¶¨ÒåÓëÓ÷¨

The cells collection returns an array containing each cell in a table.
cells¼¯ºÏ¿É·µ»Ø°üº¬±í¸ñÖÐÿ¸öµ¥ÔªµÄÊý×é

Syntax Óï·¨

tableObject.cells[]


Example ¾ÙÀý

<html>
<head>
<script type="text/javascript">
function cell()
{
var x=document.getElementById('myTable').cells
alert(x[0].innerHTML)
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
<tr>
<td>cell 3</td>
<td>cell 4</td>
</tr>
</table>
<form>
<input type="button" onclick="cell()"
value="Alert first cell">
</form>
</body>
</html>


ÑÝÁ·

InnerHTML of a cell
ÍùÒ»¸öcellÀïinnerHTML

ÆÀÂÛ (0) All