求教 怎么把边框去掉

项目中要用到dataTable,且不需要默认的上下边框,请问怎么去掉。
我试过在table中加行间样式style="border:0;",但去掉了下面的
图片描述

<body>
<table id="example" class="display" cellspacing="0" width="100%" style="border:0;">
    <thead>
    <tr>
        <th>Name</th>
        <th>Position</th>
        <th>Office</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>Tiger Nixon</td>
        <td>System Architect</td>
        <td>Edinburgh</td>
    </tr>
    <tr>
        <td>Garrett Winters</td>
        <td>Accountant</td>
        <td>Tokyo</td>
    </tr>
    <tr>
        <td>Ashton Cox</td>
        <td>Junior Technical Author</td>
        <td>San Francisco</td>
    </tr>
    </tbody>
</table>
<script>
    $(document).ready(function() {
        $('#example').DataTable();
    } );
</script>
</body>

我尝试在tbody中加border:none; 没用, 遂尝试加一个明显的边框style="border:20px solid red;",发现被隐藏在表格下面
图片描述

阅读 6.8k
1 个回答
选择器{
    border-top: none !important;
    border-bottom: none !important;
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题