¿¤·¹¸àÆ®·ÎºÎÅÍ ÁöÁ¤µÈ ÁÙ(tr)°ú rows Ä÷¹¼ÇÀ¸·Î ºÎÅÍ Å×À̺íÀÇ ÁÙÀ» Á¦°ÅÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
iRowIndex
¼±ÅÃÀûÀÎ ¿ä¼ÒÀ̸ç, Å×À̺í·Î ºÎÅÍ Á¦°ÅµÇ´Â ÁÙÀÇ À§Ä¡¸¦ 0ºÎÅÍ ½ÃÀÛÇÏ´Â Àμö·Î ÁöÁ¤ÇÏ´Â Á¤¼öÀÌ´Ù.
¹Ýȯ°ª

¹Ýȯ°ªÀº ¾ø´Ù.

Ư±â

tFoot, tBody, ȤÀº tHead·ÎºÎÅÍ ÁÙÀ» Á¦°ÅÇϸé, µ¿½Ã¿¡ tableÀÇ rows Ä÷º¼ÇÀ¸·ÎºÎÅ͵µ ÁÙÀÌ Á¦°ÅµÈ´Ù. ¶ÇÇÑ tableÀÇ ÁÙÀÌ Á¦°ÅµÇ¸é tBodyÀÇ rows Ä÷º¼ÇÀ¸·ÎºÎÅ͵µ Á¦°ÅµÈ´Ù.

tFoot, tBody, ȤÀº tHead·ÎºÎÅÍ ÁÙÀÌ Á¦°ÅÇÏ·Á¸é iRowIndex´Â trÀÇ sectionRowIndex¸¦ Æ÷ÇÔÇÏ¿©¾ß ÇÑ´Ù. table·Î ºÎÅÍ ÁÙÀ» Á¦°ÅÇÏ·Á¸é, iRowIndex´Â trÀÇ rowIndex¸¦ Æ÷ÇÔÇÏ¿©¾ß ÇÑ´Ù.

Àû¿ë
°³Ã¼scriptIE
ÂüÁ¶
insertRow rows rowIndex sectionRowIndex

ÀÌ ¸Þ¼­µå´Â (¿µ¾î)DOM Level 1(Document Object Model Level 1)¿¡¼­ Á¤ÀǵǾú´Ù.


¿¹Á¦ Ä­1-1 ¿¹Á¦ Ä­1-2
¿¹Á¦ Ä­2-1 ¿¹Á¦ Ä­2-2
¿¹Á¦ Ä­3-1 ¿¹Á¦ Ä­3-2
<TABLE id=tableObj border=1 width=600>
<TR id=row1>
<TD id=cell11>¿¹Á¦ Ä­1-1</TD>
<TD id=cell12>¿¹Á¦ Ä­1-2</TD>
</TR>
<TR id=row2>
<TD id=cell21>¿¹Á¦ Ä­2-1</TD>
<TD id=cell22>¿¹Á¦ Ä­2-2</TD>
</TR>
<TR id=row3>
<TD id=cell31>¿¹Á¦ Ä­3-1</TD>
<TD id=cell32>¿¹Á¦ Ä­3-2</TD>
</TR>
</TABLE>
<SCRIPT>
function makeRow(){
  newTr=tableObj.insertRow(document.createElement('<TR>'));
  newTd=newTr.insertCell(document.createElement('<TD>'));
  newTd.innerText='»ý¼º, »ðÀÔµÈ ÁÙ-Ä­1';
  newTd=newTr.insertCell(document.createElement('<TD>'));
  newTd.innerText='»ý¼º, »ðÀÔµÈ ÁÙ-Ä­2';
}
function delRow(){
  tableObj.deleteRow(0);
}
</SCRIPT>
<BUTTON onclick="delRow();">Å×À̺í ÁÙ Á¦°Å Ŭ¸¯</BUTTON>
<BUTTON onclick="makeRow();">Å×À̺í ÁÙ »ý¼º Ŭ¸¯</BUTTON>