table添加水平滚动条

<html>
 <head>
  <title>table新增水平滚动条</title>
        <style type="text/css">
          .tableWrap {
            overflow: auto;
          }
          table{
            width: 100%
          }
          table th{
            white-space: nowrap;
          }
          table td{
            white-space: nowrap;
          }
    </style>
    </head>
    <body>
    <div class="tableWrap">
        <table>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
             <tr><td>2222</td><tr>
        </table>
    </div>
    </body>
</html>

 

posted @ 2019-11-06 11:34  嘆世殘者——華帥  阅读(562)  评论(0编辑  收藏  举报