°³Ã¼ÀÇ Á¤º¸¸¦ À§ÇÑ Äµé(cells)ÀÇ Çì´õ(header)µéÀÇ ¸ñ·ÏÀ» ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
¹®ÀÚ¿Àº ÇØ´ç Å×À̺í ÁÙ(tr)ÀÇ Ä(td, th)µéÀÇ idµéÀÌ ºó¹®ÀÚ(°ø¹é)·Î ºÐ¸®µÈ ¸ñ·ÏÀÌ´Ù.
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
ÀÌ ¼Ó¼ºÀº À½¼ºÀ̳ª Á¡ÀÚµîÀÇ º¸ÀÌÁö ¾Ê´Â¸Þµð¾Æ¿¡ »ç¿ëÇÒ ¼ö ÀÖ°í, ¶ÇÇÑ ½ºÅ¸ÀϽ¬Æ®(CSS)¿Í ÇÔ²² »ç¿ëÇÒ ¼ö ÀÖ´Ù.
ÀÛ¼ºÀÚ°¡ ±â´ÉÀ» Á¤ÀÇÇÏ¿© ºÎ¿©ÇÏÁö ¾ÊÀ¸¸é ±â´É¼ºÀÌ ¾ø´Ù.
| °³Ã¼ | script | HTML | ±Ô°Ý | IE |
|---|
ÀÌ ¼Ó¼ºÀº HTML 4.0¿Í (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
<TABLE id=tblObj border=1 width=600 bgcolor=#ffffcc>
<SCRIPT>
str='';
for(i=0;i<5;i++){
str+='<TR id=tr'+i+'>';
for(j=0;j<3;j++){
str+='<TD headers=td'+i+j+'>Ä '+i+'-'+j+' µ¥ÀÌÅÍ</TD>';
}
str+='</TD>';
}
document.write(str);
</SCRIPT>
</TABLE>
<DIV id=showArea style="border:solid 1 blue;font-size:90%">
<SCRIPT>
str='';
for (i=0;i<5;i++){
str+=tblObj.rows[i].id+': ';
for(j=0;j<3;j++){
str+='tblObj.rows['+i+'].cells['+j+'].headers='+tblObj.rows[i].cells[j].headers+', ';
}
str+='<BR>';
}
document.write(str);
</SCRIPT>