HTML·Î ÀÛ¼º µÈ »ö»óÇ¥   Javascript·Î ÀÛ¼ºµÈ »ö»ó ¼±Åà ÇÁ·Î±×·¥

ÀÌ Ç¥´Â Javascript·Î ÀÛ¼ºµÇ¾ú´Ù. ½Ã°£ÀÌ ¾à°£ °É¸°´Ù.
»ö»ó ÄÚµå(color triplet)´Â HTML °ú Javascript ¿¡¼­ Internet Explorer, Netscape¿¡¼­ °øÈ÷ »ç¿ëµÈ´Ù.


HTML Code
<HEAD> <LINK rel="stylesheet" type="text/css" href="../public/jscript.css"> <SCRIPT Language="Javascript" src="colordb.js"></SCRIPT> </HEAD>
<BODY> <TABLE width=98% border=0 align=center> <TR><TD> <DIV align=center> <A href="http://trio.co.kr/webrefer/htex/htxclrtbl1.html"><SPAN class=example>HTML·Î ÀÛ¼º µÈ »ö»óÇ¥</A></SPAN>   <A href="xclrindex.html" target=jsmain><SPAN class=example>Javascript·Î ÀÛ¼ºµÈ »ö»ó ¼±Åà ÇÁ·Î±×·¥</SPAN></A></DIV> <P class=teal>ÀÌ Ç¥´Â Javascript·Î ÀÛ¼ºµÇ¾ú´Ù. ½Ã°£ÀÌ ¾à°£ °É¸°´Ù.<BR> »ö»ó ÄÚµå(color triplet)´Â HTML °ú Javascript ¿¡¼­ Internet Explorer, Netscape¿¡¼­ °øÈ÷ »ç¿ëµÈ´Ù.</P> <TABLE border=0 cellpadding=2 cellspacing=0 width=100% align=center> <TR valign=top><TD width=50%> <SCRIPT Language="Javascript"> <!-- °¨Ãã maketable(); tablestr='<TABLE border=1 cellpadding=2 cellspacing=0 width=95% align=center>'; tablestr+='<COL style=color:teal><COL><COL style=padding-left:9><COL><COL style=padding-left:9>'; tablestr+='<TR bgcolor=eeeeee>'; tablestr+='<TD width=5% style=vertical-align:middle>#</TD>'; tablestr+='<TD width=15% style=white-space:nowrap;vertical-align:middle>»ö»ó</TD>'; tablestr+='<TD width=25% align="left"><B>»ö»ó¸í</B><BR>name</TD>'; tablestr+='<TD width=5%><B>»ö»ó</B><BR><FONT size=-1>rrggbb</FONT></TD>'; tablestr+='<TD width=25%><B>rrggbb</B><BR><FONT size=-1>(triplet)</FONT></TD></TR>'; for (i = 1; i <= List.length; i++) { if (i==71) document.write ('</TABLE></TD><TD>'); if ((i==1)||(i==71)) document.write (tablestr) document.write ('<TR><TD>'+i+'</TD><TD bgcolor=' + List[i].str + '> </TD><TD>'+List[i].str+'</TD>'); document.write ('<TD bgcolor=#' + List[i].trip + '> </TD><TD>' + List[i].trip.fixed() + '</TD></TR>'); } // °¨Ãã ³¡ --> </SCRIPT> </TABLE> </TD></TR></TABLE> </TD></TR></TABLE> </BODY>

HTML Code È­ÀÏ: colordb.js(»ö»ó µ¥ÀÌÅͺ£ÀÌÆ®) ³»¿ë
<!--°¨Ãã
function newarray(n) {	// »õ·Î¿î ¹è¿­º¯¼ö Çü¼º
   this.length = n;
   for (var i = 1; i <= n; i++) {
      this[i] = 0;		// ¹è¿­º¯¼ö ³»¿ë Áö¿ò
   }
   return this;		// n=140
}
function Color(str,trip) {	// »ö»óÀÇ µÎ º¯¼ö »ö»ó¸í(str: string literal)°ú ÄÚµå(trip: triplet) Á¤ÀÇ
   this.str = str;		// this ¹è¿­º¯¼ö¿¡ ÀúÀå
   this.trip = trip;
}
function maketable() {	// 140 »ö»ó ¸ñ·ÏÀ» ¸¸µë
   List = new newarray(140);
   List[1] = new Color('aliceblue', 'F0F8FF');
   List[2] = new Color('antiquewhite', 'FAEBD7');
   List[3] = new Color('aqua', '00FFFF');
   List[4] = new Color('aquamarine', '7FFFD4');
   List[5] = new Color('azure', 'F0FFFF');
... Áß°£ »ý·« ...
   List[138] = new Color('whitesmoke', 'F5F5F5');
   List[139] = new Color('yellow', 'FFFF00');
   List[140] = new Color('yellowgreen', '9ACD32');
}
// °¨Ãã ³¡  -->