µð½ºÇ÷¹À̳ª Å×ÀÌºí¿¡ »ó´ëÀûÀ¸·Î °³Ã¼¸¦ Á¤·ÄÇÏ´Â ¹æ¹ýÀ» ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
center | Áß¾Ó¿¡ Á¤·ÄÇÑ´Ù. | th ¿¤·¹¸àÆ®¿¡¼´Â center°¡ µðÆúÆ®ÀÌ´Ù. |
justify | ¿ÞÂÊ°ú ¿À¸¥ÂÊ Å׵θ®¿¡ Á¤·ÄÇÑ´Ù. | div hn p ¿¤·¹¸àÆ®¿¡¼¸¸ °¡´É |
left | µðÆúÆ®À̸ç, ¿ÞÂÊ Å׵θ®¿¡ Á¤·ÄÇÑ´Ù. | |
right | ¿À¸¥ÂÊ Å׵θ®¿¡ Á¤·ÄÇÑ´Ù. |
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±â·Î µðÆúÆ®°ªÀº leftÀÌ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
HTML ±Ô°Ý¿¡¼ ºÒ·®ÇÑ °ÍÀÌ µÇ¾ú´Ù.
ÀÌ ¼Ó¼ºÀº (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
R1C1 | R1C2 | R1C3 | R1C4 | R1C5 |
R2C1 | R2C2 | R2C3 | R2C4 | R2C5 |
R3C1 | R3C2 | R3C3 | R3C4 | R3C5 |
R4C1 | R4C2 | R4C3 | R4C4 | R4C5 |
<TABLE id="tableObj" border=1 width=90% align="center"> <COL align="right" style="color:blue"><COLGROUP align="center" style="color:teal"><COL><COL></COLGROUP> <TR><TD>R1C1</TD><TD>R1C2</TD><TD>R1C3</TD><TD>R1C4</TD><TD>R1C5</TD></TR> <TR><TD>R2C1</TD><TD>R2C2</TD><TD>R2C3</TD><TD>R2C4</TD><TD>R2C5</TD></TR> <TR align="left"><TD>R3C1</TD><TD>R3C2</TD><TD>R3C3</TD><TD>R3C4</TD><TD align="center">R3C5</TD></TR> <TFOOT align="center" style="color:red"> <TR><TD align=left>R4C1</TD><TD>R4C2</TD><TD>R4C3</TD><TD>R4C4</TD><TD>R4C5</TD></TR> </TFOOT> </TABLE> <SCRIPT> str='tableObj.align='+tableObj.align+'<BR>'; tbCol=tableObj.all; str+='tbCol.length='+tbCol.length+'<BR>'; for (i=0;i< tbCol.length;i++){ if (tbCol(i).align){ str+='<SPAN style=width:6em>'+tbCol(i).nodeName+'</SPAN>'; str+='<SPAN style=width:11em>tbCol('+i +').align=<FONT color=blue>'+tbCol(i).align+'</FONT></SPAN>'; str+='<SPAN style=width:11em>tbCol('+i+').innerText=<FONT color=green>'+tbCol(i).innerText+'</FONT></SPAN><BR>'; } } document.write(str); </SCRIPT>
<DIV id="divObj" width="600" align="justify" style="border:solid 1 blue;color:blue">¹®´Ü ¹®ÀÚ¿.</DIV> <SELECT onchange="divObj.align=this.value;showA.innerText='divObj.align='+divObj.align"> <OPTION value="left" selected>left <OPTION value="center">center <OPTION value="right">right <OPTION value="justify">justify </SELECT> <DIV id=showA>°á°ú Ç¥½Ãâ</DIV>