當柳上原的風吹向天際的時候...

          真正的快樂來源于創造

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            368 Posts :: 1 Stories :: 201 Comments :: 0 Trackbacks
          以前我們已經做過兩個了,今天有空再做一個,對于練手積累都是有好處的。

          下面是效果圖:


          CSS定義部分:
            <style type="text/css">
                  <!--
                  Table.stock
          {
                      border-top
          :1px solid #91b0cc;
                      border-bottom
          :1px solid #91b0cc;
                      border-left
          :1px solid #91b0cc;
                      border-right
          :1px solid #91b0cc;
                  
          }

                  Table.stock caption
          {
                      font-size
          :15px;
                      font-weight
          :bold;
                      text-align
          :left;
                      height
          :24px;
                      line-height
          :24px;
                      
                      border-top
          :1px solid #91b0cc;
                      border-bottom
          :0px dashed #91b0cc;
                      border-left
          :1px solid #91b0cc;
                      border-right
          :1px solid #91b0cc;
                      
                      padding-left
          :5px;
                      color
          :#484848;
                      background-image
          :url(img/titBg.gif);
                  
          }

                  Table.stock th
          {
                      font-size
          :13px;
                      font-weight
          :normal;
                      background-color
          :#f2f9ff;
                      border-bottom
          :1px solid #91b0cc;
                      color
          :#62676b;
                      height
          :20px;
                      line-height
          :20px;
                      text-align
          :center;
                  
          }    

                  Table.stock td
          {    
                      border-bottom
          :1px solid #e6e6e6;
                      color
          :#62676b;
                      height
          :20px;
                      line-height
          :20px;
                      
                      text-align
          :center;
                  
          }

                  Table.stock td a
          {    
                      color
          :#002b8d;
                      text-decoration
          : underline;
                  
          }

                  Table.stock td a:hover
          {    
                      color
          :#cc0000;
                      text-decoration
          : underline;
                  
          }

                  .odd
          {
                      background-color
          :#ffffff;
                  
          }
                  .even
          {
                      background-color
          :#f5f5f5;
                  
          }

                  -->
              </style>

          所有代碼:
          <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
          <html>
           
          <head>
            
          <title>jQuery First</title>
            
          <style type="text/css">
              <!--
              Table.stock
          {
                border-top
          :1px solid #91b0cc;
                border-bottom
          :1px solid #91b0cc;
                border-left
          :1px solid #91b0cc;
                border-right
          :1px solid #91b0cc;
              
          }

              Table.stock caption
          {
                font-size
          :15px;
                font-weight
          :bold;
                text-align
          :left;
                height
          :24px;
                line-height
          :24px;
                
                border-top
          :1px solid #91b0cc;
                border-bottom
          :0px dashed #91b0cc;
                border-left
          :1px solid #91b0cc;
                border-right
          :1px solid #91b0cc;
                
                padding-left
          :5px;
                color
          :#484848;
                background-image
          :url(img/titBg.gif);
              
          }

              Table.stock th
          {
                font-size
          :13px;
                font-weight
          :normal;
                background-color
          :#f2f9ff;
                border-bottom
          :1px solid #91b0cc;
                color
          :#62676b;
                height
          :20px;
                line-height
          :20px;
                text-align
          :center;
              
          } 

              Table.stock td
          {    
                border-bottom
          :1px solid #e6e6e6;
                color
          :#62676b;
                height
          :20px;
                line-height
          :20px;
                
                text-align
          :center;
              
          }

              Table.stock td a
          {    
                color
          :#002b8d;
                text-decoration
          : underline;
              
          }

              Table.stock td a:hover
          {    
                color
          :#cc0000;
                text-decoration
          : underline;
              
          }

              .odd
          {
                background-color
          :#ffffff;
              
          }
              .even
          {
                background-color
          :#f5f5f5;
              
          }

              -->
            
          </style>
           
          </head>

           
          <body>
             
          <table class="stock" width="600" cellspacing="0">
                  
          <caption>潛力股票一覽(2009年8月22日)</caption>
                  
          <thead>
                      
          <tr>
                          
          <th>代號</th>
                          
          <th>名稱</th>
                          
          <th>價格</th>
                          
          <th>漲跌幅</th>
                          
          <th>所屬板塊</th>
                          
          <th>子板塊</th>
                      
          </tr>
                  
          </thead>
                  
          <tbody>
                      
          <tr class="odd">
                          
          <td>600362</td>
                          
          <td>江西銅業</td>
                          
          <td>36.89</td>
                          
          <td>0.52%</td>
                          
          <td><href="#">有色金屬</a></td>
                          
          <td><href="#">銅業板塊</a></td>
                      
          </tr>
                      
          <tr class="even">
                          
          <td>601088</td>
                          
          <td>中國神華</td>
                          
          <td>33.27</td>
                          
          <td>2.37%</td>
                          
          <td><href="#">煤炭石油</a></td>
                          
          <td><href="#">煤炭板塊</a></td>
                      
          </tr>
                      
          <tr class="odd">
                          
          <td>000878</td>
                          
          <td>云南銅業</td>
                          
          <td>30.04</td>
                          
          <td>0.13%</td>
                          
          <td><href="#">有色金屬</a></td>
                          
          <td><href="#">銅業板塊</a></td>
                      
          </tr>
                      
          <tr class="even">
                          
          <td>600348</td>
                          
          <td>國陽新能</td>
                          
          <td>41.05</td>
                          
          <td>6.23%</td>
                          
          <td><href="#">煤炭石油</td>
                          
          <td><href="#">煤炭板塊</td>
                      
          </tr>
                      
          <tr class="odd">
                          
          <td>000762</td>
                          
          <td>西藏礦業</td>
                          
          <td>18.99</td>
                          
          <td>1.98%</td>
                          
          <td><href="#">有色金屬</a></td>
                          
          <td><href="#">稀缺資源</a></td>
                      
          </tr>            
                      
          <tr class="even">
                          
          <td>600269</td>
                          
          <td>贛粵高速</td>
                          
          <td>13.79</td>
                          
          <td>5.83%</td>
                          
          <td><href="#">運輸物流</a></td>
                          
          <td><href="#">高速公路</a></td>
                      
          </tr>
                  
          </tbody>
              
          </table>
           
          </body>
          </html>

          <SCRIPT LANGUAGE="JavaScript">
          <!--

            
          //-->
          </SCRIPT>

          代碼下載:
          http://www.aygfsteel.com/Files/heyang/JsTable20090822203614.rar

          posted on 2009-08-22 20:40 何楊 閱讀(897) 評論(4)  編輯  收藏

          Feedback

          # re: 又一個表格CSS例子 2009-08-23 08:19 keer
          如果你用jQuery, 處理類似的表格樣式的話,代碼不超過10行,呵呵  回復  更多評論
            

          # re: 又一個表格CSS例子 2009-08-23 08:20 keer
          我把地址給你 http://www.style5.cn/archives/91  回復  更多評論
            

          # re: 又一個表格CSS例子 2009-08-23 10:47 heyang
          @keer

          嗯,jQuery是能幫我做不少事,但有些細節我覺得還是自己動手好。如表格的CSS定義。至于間隔色,自己完成也很容易。只是jQuery的hover功能比較牛,有空再看看源碼。  回復  更多評論
            

          # re: 又一個表格CSS例子 2009-08-23 10:48 heyang
          @keer

          http://www.aygfsteel.com/heyang/archive/2009/08/22/292221.html

          這個是我自己做的表格處理類。歡迎批評指正。  回復  更多評論
            


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 湄潭县| 静安区| 繁峙县| 泸州市| 古浪县| 清新县| 莆田市| 小金县| 历史| 黎川县| 水城县| 满城县| 石楼县| 梨树县| 上蔡县| 新乡市| 汤阴县| 荥阳市| 乌兰察布市| 百色市| 雅江县| 光山县| 新巴尔虎左旗| 龙陵县| 泉州市| 张家港市| 文成县| 德令哈市| 开封市| 定边县| 霸州市| 宣汉县| 清水河县| 安化县| 房山区| 福鼎市| 嘉禾县| 武定县| 出国| 安塞县| 新巴尔虎右旗|