js+table+css 的选项卡


 <STYLE type=text/css>
.table1 {
 BORDER-RIGHT: gray 1px solid;
  BORDER-TOP: #ffffff 1px solid;
  BORDER-LEFT: #ffffff 1px solid;
  CURSOR: hand; COLOR: #000000;
  BORDER-BOTTOM: #ffffff 1px solid;
  BACKGROUND-COLOR: #eeeeee;
  font-size:12px;
}
.table2 {
 BORDER-RIGHT: gray 1px solid;
 BORDER-TOP: #ffffff 1px solid;
 FONT-WEIGHT: bold;
 BORDER-LEFT: #ffffff 1px solid;
 CURSOR: hand; COLOR: #000000;
 BACKGROUND-COLOR: #d4d0c8;
 font-size:12px;
}
.m_tab {
 BORDER-RIGHT: gray 1px solid;
 BORDER-LEFT: #ffffff 1px solid;
 COLOR: #000000;
 BORDER-BOTTOM: gray 1px solid;
 BACKGROUND-COLOR: #d4d0c8;

}

tbody{font-size:12px}

</STYLE>


<SCRIPT language=javascript>
     function choice(itemNo)
  {
    for(i=0;i<t1.cells.length;i++)
      t1.cells[i].className="table1";
    t1.cells[itemNo].className="table2";
   
    for(i=0;i<t2.tBodies.length;i++)
      t2.tBodies[i].style.display="none";
   t2.tBodies[itemNo].style.display="block";
  }
      </SCRIPT>

<div style="width:420;border:solid 1px black">
            <TABLE id=t1 cellSpacing=0 cellPadding=0 width=420 border=0>
              <TBODY>
              <TR align=middle height=20>
                <TD class=table2 οnclick=choice(0)>第一项</TD>
                <TD class=table1 οnclick=choice(1)>第二项</TD>
                <TD class=table1 οnclick=choice(2)>第三项</TD>
                <TD class=table1 οnclick=choice(3)>第四项</TD>
                </TR>
                </TBODY>
              </TABLE>
             
             
            <TABLE class=m_tab id=t2 cellSpacing=0 cellPadding=0 width=400 border=0>
             
           
                <TBODY style="DISPLAY: block">
                <TR>
                 <TD vAlign=top align=middle style="padding:10px">
                 
                 
                      <TABLE cellSpacing=0 cellPadding=0 width=398 border=0>
                      
                        <TR>
                          <td>
                           这里是第一项的内容......
                         </td>
                        </TR>
                      
                        </TABLE>
                   
                    </TD>
                    </TR>
                    </TBODY>
                   
                   
                  <TBODY style="DISPLAY: none">
                <TR>
                 <TD vAlign=top align=middle style="padding:10px">
                 
                 
                      <TABLE cellSpacing=0 cellPadding=0 width=398 border=0>
                      
                        <TR>
                          <td>
                           这里是第二项的内容......
                         </td>
                        </TR>
                      
                        </TABLE>
                   
                    </TD>
                    </TR>
                    </TBODY>
                   
                  <TBODY style="DISPLAY: none">
                <TR>
                 <TD vAlign=top align=middle style="padding:10px">
                 
                 
                      <TABLE cellSpacing=0 cellPadding=0 width=398 border=0>
                      
                        <TR>
                          <td>
                           这里是第三项的内容......
                         </td>
                        </TR>
                      
                        </TABLE>
                   
                    </TD>
                    </TR>
                    </TBODY>
                   
                   
                  <TBODY style="DISPLAY: none">
                <TR>
                 <TD vAlign=top align=middle style="padding:10px">
                 
                 
                      <TABLE cellSpacing=0 cellPadding=0 width=398 border=0>
                      
                        <TR>
                          <td>
                           这里是第四项的内容......
                         </td>
                        </TR>
                      
                        </TABLE>
                   
                    </TD>
                    </TR>
                    </TBODY>
             
              </TABLE>

</div>


 

<script language=javascript> function choice(itemNo) { for(i=0;i

第一项第二项第三项第四项
这里是第一项的内容......
这里是第二项的内容......
这里是第三项的内容......
这里是第四项的内容......

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值