Bootstrap響應(yīng)式表格詳解
Bootstrap 的響應(yīng)式 CSS 能夠自適應(yīng)于臺(tái)式機(jī)、平板電腦和手機(jī)
下面是手機(jī)端顯示的樣式
代碼如下:
1.test.php
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無(wú)標(biāo)題文檔</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元素和媒體查詢 --> <!-- 注意: 如果通過(guò) file:// 引入 Respond.js 文件,則該文件無(wú)法起效果 --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body> <h1>汽車(chē)信息</h1> <table class="table table-striped"> <thead> <tr> <th>代號(hào)</th> <th>名稱(chēng)</th> <th class="hidden-xs">系列</th> <th class="hidden-xs">上市時(shí)間</th> <th class="hidden-xs">油耗</th> <th class="hidden-xs">功率</th> <th>價(jià)格</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> <!-- 模態(tài)框(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">汽車(chē)詳細(xì)信息</h4> </div> <div class="modal-body" id="neirong"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">關(guān)閉</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal --> </div> <script type="text/javascript"> $(".xq").click(function(){ //顯示詳細(xì)信息 //取代號(hào) var code = $(this).attr("code"); //查詢?cè)撈?chē)的所有信息 $.ajax({ url:"chuli.php", data:{code:code}, type:"POST", dataType:"TEXT", success: function(data){ var lie = data.trim().split("^"); var str = "<div>代號(hào):"+lie[0]+"</div><div>名稱(chēng):"+lie[1]+"</div> <div>系列:"+lie[2]+"</div><div>上市時(shí)間:"+lie[3]+"</div><div>油耗:"+lie[4]+"</div><div>功率:"+lie[5]+"</div><div>價(jià)格:"+lie[7]+"</div>"; $("#neirong").html(str); //觸發(fā)模態(tài)框 $('#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);
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- BootStrap學(xué)習(xí)筆記之nav導(dǎo)航欄和面包屑導(dǎo)航
- Bootstrap CSS組件之面包屑導(dǎo)航(breadcrumb)
- Bootstrap組件學(xué)習(xí)之導(dǎo)航、標(biāo)簽、面包屑導(dǎo)航(精品)
- bootstrap響應(yīng)式表格實(shí)例詳解
- Bootstrap禁用響應(yīng)式布局的實(shí)現(xiàn)方法
- Bootstrap Navbar Component實(shí)現(xiàn)響應(yīng)式導(dǎo)航
- Bootstrap開(kāi)發(fā)實(shí)戰(zhàn)之響應(yīng)式輪播圖
- BootStrap創(chuàng)建響應(yīng)式導(dǎo)航條實(shí)例代碼
- 談一談bootstrap響應(yīng)式布局
- bootstrap-treeview自定義雙擊事件實(shí)現(xiàn)方法
- BootStrap中關(guān)于Select下拉框選擇觸發(fā)事件及擴(kuò)展
- bootstrap動(dòng)態(tài)添加面包屑(breadcrumb)及其響應(yīng)事件的方法
相關(guān)文章
uniapp 實(shí)現(xiàn)微信小程序全局分享的示例代碼
本文主要介紹了uniapp 實(shí)現(xiàn)微信小程序全局分享的示例代碼,文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-12-12Easy.Ajax 部分源代碼 支持文件上傳功能, 兼容所有主流瀏覽器
下面是Easy.Ajax類(lèi)的初稿,如須發(fā)表,在代碼上還要修改以達(dá)到最簡(jiǎn),但API是不會(huì)變了2011-02-02JS構(gòu)建頁(yè)面的DOM節(jié)點(diǎn)結(jié)構(gòu)的實(shí)現(xiàn)代碼
本來(lái)想用json格式的,可是要么有重復(fù),要么得嵌套,所以改用對(duì)象嵌套數(shù)組2011-12-12js判斷手機(jī)和pc端選擇不同執(zhí)行事件的方法
這篇文章主要介紹了js判斷手機(jī)和pc端選擇不同執(zhí)行事件的方法,可實(shí)現(xiàn)判斷手機(jī)端還是PC端再選擇對(duì)應(yīng)的執(zhí)行事件的功能,是非常實(shí)用的技巧,需要的朋友可以參考下2015-01-01微信小程序通過(guò)點(diǎn)擊事件跨頁(yè)面?zhèn)鲄⒓癲ata-方法傳參(data-)的示例詳解
在?vue?中,我們可以直接在點(diǎn)擊事件中放入傳遞的參數(shù)進(jìn)行傳參;然而微信小程序中并不適用這樣的寫(xiě)法,但是微信小程序可以通過(guò)自定義屬性從而綁定參數(shù)使用,這篇文章主要介紹了微信小程序通過(guò)點(diǎn)擊事件跨頁(yè)面?zhèn)鲄⒁约癲ata-方法傳參(data-),需要的朋友可以參考下2023-12-12JavaScript格式化數(shù)字的函數(shù)代碼
當(dāng)要格式化的數(shù)字為null、空或非數(shù)字時(shí),返回的結(jié)果。默認(rèn)為02010-11-11javascript 用函數(shù)語(yǔ)句和表達(dá)式定義函數(shù)的區(qū)別詳解
本篇文章主要介紹了javascript 用函數(shù)語(yǔ)句和表達(dá)式定義函數(shù)的區(qū)別。需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-01-01