Bootstrap响应式表格详解
网络编程 2021-07-04 18:32www.168986.cn编程入门
这篇文章主要为大家详细介绍了Bootstrap响应式表格的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
Bootstrap 的响应式 CSS 能够自适应于台式机、平板电脑和手机
狼蚁网站SEO优化是手机端显示的样式
代码如下:
1.test.php
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <link type="text/css" rel="stylesheet" href="../bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="external nofollow" /> <script src="jquery-3.2.0.min.js"></script> <script src="../bootstrap-3.3.7-dist/js/bootstrap.min.js"></script> <!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 --> <!-- 注意: 如果通过 file:// 引入 Respond.js 文件,则该文件无法起效果 --> <!--[if lt IE 9]> <script src="https://oss.maxcdn./libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn./libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body> <h1>汽车信息</h1> <table class="table table-striped"> <thead> <tr> <th>代号</th> <th>名称</th> <th class="hidden-xs">系列</th> <th class="hidden-xs">上市时间</th> <th class="hidden-xs">油耗</th> <th class="hidden-xs">功率</th> <th>价格</th> <th class="visible-xs-block">详情</th> </tr> </thead> <tbody> <?php require "DBDA.class.php"; $db = new DBDA(); $sql = "select * from car"; $arr = $db->query($sql,1); foreach($arr as $v) { echo "<tr> <td>{$v[0]}</td> <td>{$v[1]}</td> <td class='hidden-xs'>{$v[2]}</td> <td class='hidden-xs'>{$v[3]}</td> <td class='hidden-xs'>{$v[4]}</td> <td class='hidden-xs'>{$v[5]}</td> <td>{$v[7]}</td> <td class='visible-xs-block'> <button type='button' class='btn btn-primary btn-xs xq' code='{$v[0]}'>详情</button> </td> </tr>"; } ?> </tbody> </table> <!-- 模态框(Modal) --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">汽车详细信息</h4> </div> <div class="modal-body" id="neirong"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal --> </div> <script type="text/javascript"> $(".xq").click(function(){ //显示详细信息 //取代号 var code = $(this).attr("code"); //查询该汽车的所有信息 $.ajax({ url:"chuli.php", data:{code:code}, type:"POST", dataType:"TEXT", suess: function(data){ var lie = data.trim().split("^"); var str = "<div>代号:"+lie[0]+"</div><div>名称:"+lie[1]+"</div> <div>系列:"+lie[2]+"</div><div>上市时间:"+lie[3]+"</div><div>油耗:"+lie[4]+"</div><div>功率:"+lie[5]+"</div><div>价格:"+lie[7]+"</div>"; $("#neirong").html(str); //触发模态框 $('#myModal').modal('show'); } }); }) </script> </body> </html>
2.chuli.php
<?php $code = $_POST["code"]; require "DBDA.class.php"; $db = new DBDA(); $sql = "select * from car where code='{$code}'"; echo $db->strquery($sql);
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持狼蚁SEO。
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程