1-16. Bootstrap中表格问题详解

Bootstrap表格

 

表格类

 

<tr>, <th> 和 <td> 类

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link href="Bootstrap/css/bootstrap.css" rel="stylesheet" />
		
		<style type="text/css">
			table{
				width:100%;
				font-size: 18px;
				line-height: 45px;
			}

            td{
                mid-width:500px;  //最小宽度为500
              }

		</style>
	</head>
	<body>
		<div class="container">
		<table class="table table-striped table-bordered table-hover table-condensed">
			<thead>
				<tr>
					<td>中国军事</td>
					<td>美国军事</td>
					<td>俄罗斯军事</td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td class="active">江苏军事</td>
					<td>浙江军事</td>
					<td class="success">重庆军事</td>
				</tr>
				
				<tr>
					<td class="info">江苏军事</td>
					<td class="warning">浙江军事</td>
					<td class="danger">重庆军事</td>
				</tr>
				
				<tr>
					<td>江苏军事</td>
					<td>浙江军事</td>
					<td>重庆军事</td>
				</tr>
			</tbody>
		</table>
		</div>
			
		
		<script src="Bootstrap/js/bootstrap.js"></script>	
		<script src="bootstrap/js/jquery-1.11.3.min.js"></script>
	</body>
</html>

效果如下:

 

把table表格包在含table-responsive class的div内,可以让表格水平滚动以适应小型设备

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值