Bootstrap 基本样式-表格

1 : 基本表格    table
2 : 带斑马线的表格    table table-striped
3 : 带边框的表格    table table-bordered
4 : 有鼠标悬停状态的表格    table table-hover
5 : 更加紧凑的表格    table table-condensed
6 : 多种表格效果整合在一起    table table-striped table-bordered table-hover  table-condensed
7 : 激活样式    active
8 : 成功样式    success
9 : 信息样式    info
10 : 警告样式    warning
11 : 危险样式    danger

  • 基本表格

    拥有横向分割线的表格,宽度占用父容器的

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td>616</td> 
         </tr>
     <tr>
            <td><img width="20px" src="teemo.png"/></td> 
            <td>提莫</td> 
            <td>383</td> 
         </tr>
     <tr>
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 带斑马线的表格

    通过斑马线把奇偶行的区别表现出来

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table table-striped">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td>616</td> 
         </tr>
     <tr>
            <td><img width="20px" src="teemo.png"/></td> 
            <td>提莫</td> 
            <td>383</td> 
         </tr>
     <tr>
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 带边框的表格

    给表格的单元格加上边框
    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table table-bordered">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td>616</td> 
         </tr>
     <tr>
            <td><img width="20px" src="teemo.png"/></td> 
            <td>提莫</td> 
            <td>383</td> 
         </tr>
     <tr>
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 有鼠标悬停状态的表格

    鼠标悬停高亮显示


    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table table-hover">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td>616</td> 
         </tr>
     <tr>
            <td><img width="20px" src="teemo.png"/></td> 
            <td>提莫</td> 
            <td>383</td> 
         </tr>
     <tr>
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 更加紧凑的表格

    让表格更加紧凑

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table table-condensed">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td>616</td> 
         </tr>
     <tr>
            <td><img width="20px" src="teemo.png"/></td> 
            <td>提莫</td> 
            <td>383</td> 
         </tr>
     <tr>
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 多种表格效果整合在一起

    多种表格样式混合使用
    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table table-striped table-bordered table-hover  table-condensed">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td>616</td> 
         </tr>
     <tr>
            <td><img width="20px" src="teemo.png"/></td> 
            <td>提莫</td> 
            <td>383</td> 
         </tr>
     <tr>
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 激活样式

    用于表示该行被选中

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td >616</td> 
         </tr>
     <tr>
            <td ><img width="20px" src="lol/teemo.png"/></td> 
            <td >提莫</td> 
            <td >383</td> 
         </tr>
     <tr  class="active">
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 成功样式

    用于表示该行的信息是成功的

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td >616</td> 
         </tr>
     <tr>
            <td ><img width="20px" src="teemo.png"/></td> 
            <td >提莫</td> 
            <td >383</td> 
         </tr>
     <tr  class="success">
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 信息样式

    用于表示该行的信息是正常的

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td >616</td> 
         </tr>
     <tr>
            <td ><img width="20px" src="teemo.png"/></td> 
            <td >提莫</td> 
            <td >383</td> 
         </tr>
     <tr  class="info">
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 警告样式

    用于表示该行的信息有疑问

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table">
      <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td >616</td> 
         </tr>
     <tr>
            <td ><img width="20px" src="teemo.png"/></td> 
            <td >提莫</td> 
            <td >383</td> 
         </tr>
     <tr  class="warning">
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>
  • 危险样式

    用于表示该行的信息有错误

    <!DOCTYPE html>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
     
    <table class="table">
        <thead>
         <th>头像</th>
         <th>名字</th>
         <th>HP</th>
      </thead>
      <tbody>
         <tr>
            <td><img width="20px" src="gareen.png"/></td> 
            <td>盖伦</td> 
            <td >616</td> 
         </tr>
     <tr>
            <td ><img width="20px" src="teemo.png"/></td> 
            <td >提莫</td> 
            <td >383</td> 
         </tr>
     <tr  class="danger">
            <td><img width="20px" src="akali.png"/></td> 
            <td>阿卡丽</td> 
            <td>448</td> 
         </tr>
      </tbody>
    </table>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: bootstrap-table-export是一个基于Bootstrap框架的表格插件,用于导出表格数据为不同格式的文件。 通过使用bootstrap-table-export插件,我们可以方便地将表格数据导出为Excel、CSV、JSON等格式的文件,以便于后续的数据分析、存档或分享。 bootstrap-table-export提供了一些简单易用的API,使得我们可以灵活地控制导出的文件格式、文件名、是否包含表头、是否仅导出当前页的数据等。 使用bootstrap-table-export,我们只需要在表格中添加相应的导出按钮,并绑定相应的事件,即可实现导出功能。对于需要导出的表格,还可以通过一些配置选项,对导出的数据进行进一步的筛选和格式化。 除了导出功能,bootstrap-table-export还支持一些其他的扩展功能,如自定义表格样式、分页、搜索、排序等。可以帮助我们更好地展示和管理表格数据。 总的来说,bootstrap-table-export是一个非常方便实用的表格导出插件,能够帮助我们轻松地导出表格数据为不同格式的文件,提高了数据的利用价值和效率。 ### 回答2: bootstrap-table-export是一款基于Bootstrap框架的表格导出插件。该插件可以让我们方便地将Bootstrap表格中的数据导出为Excel、PDF、CSV等常见的文件格式,以便进行保存或进一步处理。 首先,使用bootstrap-table-export插件可以很方便地实现表格数据的导出功能,无需手动编写复杂的导出代码。只需在Bootstrap表格上添加相应的配置选项,即可实现点击按钮或菜单即可导出表格数据。 其次,bootstrap-table-export支持导出多种常见的文件格式。无论是Excel、PDF还是CSV文件,我们都可以选择导出我们需要的格式。这样在对数据进行保存或者与其他软件进行交互时,更加灵活、方便。 此外,bootstrap-table-export插件提供了丰富的配置选项,可以满足不同的导出需求。我们可以根据自己的需要设置导出的文件名、导出的表头、文件格式等等。还可以对导出文件的样式进行自定义,使得导出的文件与我们的需求更加匹配。 总之,bootstrap-table-export是一款功能强大且易于使用的表格导出插件。它可以让我们在使用Bootstrap表格时,轻松实现表格数据的导出功能,并通过提供多种文件格式和丰富的配置选项,满足不同需求,方便我们对数据进行保存或进一步处理。 ### 回答3: bootstrap-table-export是一个基于Bootstrap框架开发的表格插件,用于将数据表格导出为不同格式的文件,如Excel、CSV和PDF等。它提供了一种简便的方式来导出数据,方便用户进行数据的分析和处理。 使用bootstrap-table-export非常简单,只需要在HTML中引入必要的CSS和JavaScript文件,然后在表格上添加相应的类和属性即可。插件会自动将表格转换为可导出的格式,并提供下载或在线预览的功能。 该插件提供了丰富的配置选项,可以根据自己的需求进行定制,如选择导出的文件类型、设置导出文件的名称、隐藏不需要导出的列等。此外,它还支持导出选中的行、当前页的数据或者全部数据,使得导出更加灵活可控。 另外,bootstrap-table-export还支持自定义导出按钮的样式和位置,方便用户能够灵活的控制导出功能的展示形式。同时,它还提供了一些回调函数用于对导出过程进行处理,如在导出前进行数据格式的转换、导出完成后进行一些操作等。 总之,bootstrap-table-export是一个功能强大、易于使用的数据表格导出插件,给用户提供了便捷的导出数据的方式,使得数据分析和处理变得更加高效和方便。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值