javascript - 求教 怎么把边框去掉

查看:164
本文介绍了javascript - 求教 怎么把边框去掉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

项目中要用到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;",发现被隐藏在表格下面

解决方案

选择器{
    border-top: none !important;
    border-bottom: none !important;
}

这篇关于javascript - 求教 怎么把边框去掉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆