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

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

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

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

HTML DOM rows ¼¯ºÏ


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

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

The rows collection returns an array containing each row in a table.
rows¼¯ºÏ·µ»ØÒ»¸ö°üº¬±í¸ñÖÐÿ¸örowµÄÊý×é

Syntax Óï·¨

tableObject.rows[]


Example ¾ÙÀý

<html>
<head>
<script type="text/javascript">
function specifyRow()
{
alert(document.getElementById('myTable').rows[0].innerHTML)
}
</script>
</head>

<body>
<table id="myTable" border="1">
<tr>
<td>Row1 cell1</td>
<td>Row1 cell2</td>
</tr>
<tr>
<td>Row2 cell1</td>
<td>Row2 cell2</td>
</tr>
</table>
<form>
<input type="button" onclick="specifyRow()"
value="Show innerHTML of first row">
</form>
</body>
</html>


ÑÝÁ·

InnerHTML of a row
ÍùrowÀïinnerHTML

Add a cell to a table row through the rows collection
ͨ¹ýrows¼¯ºÏÍù±í¸ñÀï¼Ócell

Align the cell content in a table row
¶ÔÆë±í¸ñÐÐÀïcellµÄÄÚÈÝ

Vertical align the cell content in a table row
°üº¬ÔÚ±í¸ñÐÐÀïcellµÄ´¹Ö±¶ÔÆë·½Ê½

Align the cell content in a single cell
½ö¶ÔÒ»¸öcellÄÚÈݽøÐÐ¶ÔÆë

Vertical align the cell content in a single cell
½ö¶ÔÒ»¸öcellµÄÄÚÈݽøÐд¹Ö±¶ÔÆë

Change the content of a table cell
¸Ä±ä±í¸ñcellµÄÄÚÈÝ

Change the colspan of a table row
¸Ä±ä±í¸ñrowµÄ¿ç¶È

ÆÀÂÛ (0) All