Å×À̺í ÇÑ ÁÙ¿¡ Àִ ĵéÀÇ cells Ä÷º¼Ç¿¡¼ ¼ø¼¿¡ ÇØ´çÇÏ´Â Àμö¸¦ ¹ÝȯÇÑ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
ĵéÀÇ À§Ä¡ ¼ø¼´Â ¹®¼¿¡¼ ³ªÅ¸³ª´Â HTML ¼ø¼ÀÌ°í, colspan=NÀ¸·Î ĵéÀÌ ÅëÇÕµÈ °æ¿ì¿¡´Â Á¦ÀÏ ¾Õ ÄÀÇ À§Ä¡¸¸ ¹ÝȯÇÑ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
ÀÌ ¼Ó¼ºÀº (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
ÁÙ1 Ä1 | ÁÙ1 Ä2 | ÁÙ1 Ä3 | ÁÙ1 Ä4 |
ÁÙ2 Ä1 | ÁÙ2 Ä3 | ||
ÁÙ3 Ä1 | ÁÙ3 Ä2 | ÁÙ3 Ä4 | |
ÁÙ4 Ä1 |
<TABLE id=tableObj border=1 width=650> <TR id=tr1><TD id=td11>ÁÙ1 Ä1</TD><TD id=td12>ÁÙ1 Ä2</TD><TD id=td13>ÁÙ1 Ä3</TD><TD id=td14 rowspan=2>ÁÙ1 Ä4</TD></TR> <TR id=tr2><TD colspan=2>ÁÙ2 Ä1</TD><TD>ÁÙ2 Ä3</TD></TR> <TR id=tr3><TD>ÁÙ3 Ä1</TD><TD colspan=2>ÁÙ3 Ä2</TD><TD>ÁÙ3 Ä4</TD></TR> <TR id=tr4><TD colspan=4>ÁÙ4 Ä1</TD></TR> </TABLE> <DIV style="width:650;border:solid 1 blue;padding:5"> <SCRIPT> str='tableObj.rows.length='+tableObj.rows.length; for (k=0;k<TABLEOBJ.rows.length;k++) oneRow(k); str+='<BR><BR>td13.cellIndex='+td13.cellIndex+', td13.innerText='+td13.innerText; str+='<BR>tr1.all(2).cellIndex='+tr1.all(2).cellIndex+', tr1.all(2).innerText='+tr1.all(2).innerText;; str+='<BR>tableObj.rows[0].cells(2).cellIndex='+tableObj.rows[0].cells(2).cellIndex+ ', tableObj.rows[0].cells(2).innerText='+tableObj.rows[0].cells(2).innerText; document.write(str); function oneRow(k){ line=tableObj.rows[k] str+='<BR><FONT color=brown>'+line.id+'.cells.length='+line.cells.length+'</FONT><BR>'; for (i=0;i<LINE.cells.length;i++) str+='('+tableObj.rows[k].cells[i].innerText+').cellIndex=<FONT color=blue>'+ tableObj.rows[k].cells[i].cellIndex+'</FONT>, '; } </SCRIPT>