Bootstrap实现的表格合并单元格示例

利用Bootstrap设计表格,并且表格需要合并单元格

2、实现源码

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1"> <meta content=""> <meta content=""> <title>Bootstrap-表格合并单元格</title> <link href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.css" /> <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript" src="https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.js" ></script> <style> body,html{ width: 99%; height: 98%; font-family: "微软雅黑"; font-size: 14px; } table{ width: 100%; } </style> <script> </script> </head> <body> <div> <div> <table> <tr> <td> <label for="stuNo">学号:</label> <input type="text" /> <div> <button type="button" data-toggle="dropdown"> 班级 </button> <ul role="menu"> <li><a href="#" >一班</a></li> <li><a href="#" >二班</a></li> <li><a href="#" >三班</a></li> <li><a href="#" >四班</a></li> <li><a href="#" >五班</a></li> </ul> </div> <button type="button">查询</button> <button type="button">重置</button> </td> </tr> </table> </div> <div> <div> <table> <caption>学生表</caption> <thead> <tr> <th>学生</th> <th>学号</th> </tr> </thead> <tbody> <tr> <td>胡思</td> <td>2016010101</td> </tr> <tr> <td>赵四</td> <td>2016010102</td> </tr> <tr> <td>陈诚</td> <td>2016010103</td> </tr> <tr> <td>李磊</td> <td>2016010104</td> </tr> <tr> <td>孙杨</td> <td>2016010105</td> </tr> <tr> <td>李爽</td> <td>2016010106</td> </tr> </tbody> </table> <table> <caption>学生表</caption> <thead> <tr> <th>学生</th> <th>学号</th> </tr> </thead> <tbody> <tr> <td>胡思</td> <td>2016010101</td> </tr> <tr> <td>赵四</td> <td>2016010102</td> </tr> <tr> <td>陈诚</td> <td>2016010103</td> </tr> <tr> <td>李磊</td> <td>2016010104</td> </tr> <tr> <td>游豪</td> <td>2016010105</td> </tr> </tbody> </table> </div> <div> <table> <tr> <td>到校</td> <td>回家</td> <td>距离</td> </tr> <tr> <td colspan="2">222</td> <td rowspan="2"> <div> <table> <thead> <tr> <th>姓名</th> <th>学号</th> </tr> </thead> <tbody> <tr> <td>胡思</td> <td>2016010101</td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td colspan="2">333</td> </tr> </table> <table> <tr> <td>到校</td> <td>回家</td> <td>距离</td> </tr> <tr> <td colspan="2">222</td> <td rowspan="2"> <div> <table> <thead> <tr> <th>姓名</th> <th>学号</th> </tr> </thead> <tbody> <tr> <td>胡思</td> <td>2016010101</td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td colspan="2">333</td> </tr> </table> <table> <tr> <td>到校</td> <td>回家</td> <td>距离</td> </tr> <tr> <td colspan="2">222</td> <td rowspan="2"> <div> <table> <thead> <tr> <th>姓名</th> <th>学号</th> </tr> </thead> <tbody> <tr> <td>胡思</td> <td>2016010101</td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td colspan="2">333</td> </tr> </table> <table> <tr> <td>到校</td> <td>回家</td> <td>距离</td> </tr> <tr> <td colspan="2">222</td> <td rowspan="2"> <div> <table> <thead> <tr> <th>姓名</th> <th>学号</th> </tr> </thead> <tbody> <tr> <td>胡思</td> <td>2016010101</td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td colspan="2">333</td> </tr> </table> </div> </div> </div> </body> </html>

3、实现结果

Bootstrap实现的表格合并单元格示例

PS:关于bootstrap布局,这里再为大家推荐一款本站的在线可视化布局工具供大家参考使用:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ppdwf.html