Directly on the code:
1 <HTML>2 <Head>3 <Metahttp-equiv= "Content-type"content= "text/html; charset=gb3212">4 <title>Single-and two-line display of different colors</title>5 <Scripttype= "Text/javascript">6 window.onload= functioncolor () {7 varTable=document.getElementById (" Person");8 varrows=Table.getelementsbytagname ("TR");9 for(varI=0; I<Rows.length;i++){Ten if(i%2==0){ One Rows[i].style.backgroundcolor= "#EAF2D3" A }Else{ - Rows[i].style.backgroundcolor= " White"; - } the } - } - </Script> - <styletype= "Text/css"> + #person - { + Border-style:1px solid; A Border-color:Blue; at Font-weight:Bold; - font-family:italics, Arial,helvetica, Sans-serif; - Border-collapse:collapse; - margin:Auto; - } - #person th in { - Border:1px solid; to padding:3px 7px 2px 7px + Background-color: #A7C942 - Color: #ffffff the Text-align:center; * } $ #person TDPanax Notoginseng { - Border-style:Solid; the Border-width:1px; + text-align:Center; A } the </style> + </Head> - <Body> $ <TableID= "Person"Align= "Center"width= "90%"Height= "$"> $ <TR> - <th>Name</th> - <th>Gender</th> the <th>Phone</th> - <th>Hobby</th>Wuyi </TR> the <TR> - <TD>Zhangsan</TD> Wu <TD>Male</TD> - <TD>123456</TD> About <TD>Swimming</TD> $ </TR> - <TR> - <TD>Zhangsan</TD> - <TD>Male</TD> A <TD>123456</TD> + <TD>Swimming</TD> the </TR> - <TR> $ <TD>Zhangsan</TD> the <TD>Male</TD> the <TD>123456</TD> the <TD>Swimming</TD> the </TR> - </Table> in </Body> the </HTML>
HTML table single and double line color interval (reprint)