|
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>ScrollBar</title>
- <style type="text/css">
- table, th,td{
- border: #555555 2px solid;
- }
- table{
- border-collapse: collapse;
- width: 300px;
- }
- #tb2,tr,td{
- border-top:none;
- }
- th,td{
- width: 100px;
- }
- .tbcontainer{
- height: 180px;
- width: 317px;
- overflow-y: auto;
- }
- </style>
- </head>
- <body>
- <table>
- <thead>
- <tr>
- <th></th>
- <th>变更前</th>
- <th>变更后</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- <div class="tbcontainer">
- <table id="tb2">
- <tbody>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- <tr>
- <td>编程语言</td>
- <td>Hello Cobol!</td>
- <td>Hello Java</td>
- </tr>
- </tbody>
- </table>
- </div>
- </body>
- </html>
复制代码
问题:
为何tbody的第一列比th的第一列往左偏移了一个像素呢
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|