Bootstrap入门(2)表格

Bootstrap入门(四)表格
<table>标签
首先,引入bootstrap的css文件,然后表格内容放在一个class为table的<table>标签中(class="table"补足了padding和水平方向上的分割线)
<table class="table">
  ...
</table>
1.几个不同样式的表格(修改<table>标签中的class)
1.1“table”普通
            
           <table class="table">
                <thead>
                    <tr>
                        <th>biaoti</th>
                        <th>biaoti</th>
                        <th>biaoti</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th>danyuange</th>
                        <th>danyuange</th>
                        <th>danyuange</th>
                    </tr>
                    <tr>
                        <th>danyuange</th>
                        <th>danyuange</th>
                        <th>danyuange</th>
                    </tr>
                    <tr>
                        <th>danyuange</th>
                        <th>danyuange</th>
                        <th>danyuange</th>
                    </tr>
                </tbody>
            </table>      

效果:

1.2<table>标签中的class 改为“ table table-striped ”两行之前有不同的颜色(“斑马线”)
效果:
1.3<table>标签中的class 改为 “ table table-striped table-bordered ”多了水平方向上的分割线和边框
效果:
1.4<table>标签中的class 改为 “ table table-striped table-bordered table-hover ”鼠标经过、悬停时有效果
2.状态类(在<tr>标签中修改class)
跟之前的类似,有active,info,success,warning,danger等来为单元格添加标识 
               
                <table class="table table-striped table-bordered">
                    <thead>
                        <tr class="active">
                            <th>biaoti</th>
                            <th>biaoti</th>
                            <th>biaoti</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="success">
                            <th>danyuange</th>
                            <th>danyuange</th>
                            <th>danyuange</th>
                        </tr>
                        <tr class="info">
                            <th>danyuange</th>
                            <th>danyuange</th>
                            <th>danyuange</th>
                        </tr>
                        <tr class="warning">
                            <th>danyuange</th>
                            <th>danyuange</th>
                            <th>danyuange</th>
                        </tr>
                        <tr class="danger">
                            <th>danyuange</th>
                            <th>danyuange</th>
                            <th>danyuange</th>
                        </tr>
                    </tbody>
                </table>

 效果:

3.响应式效果
把内容放在一个class为table-responsive的div中
<table>的class改为“table table-condensed”
在浏览器变小的时候,不会影响表格内容,而是下方多一条滚动条
效果:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

执键行天涯、

码你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值