html – Bootstrap表 – 将行的列中的一个拆分为两个

html – Bootstrap表 – 将行的列中的一个拆分为两个,第1张

概述我设法为Bootstrap中的表创建“双行”: <table class="table table-striped table-bordered"> <tr> <th>1</th> <th>2</th> <th>3</th> </tr> <tr> <td>A</td> <td>A</td> 我设法为bootstrap中的表创建“双行”:
<table >    <tr>        <th>1</th>        <th>2</th>        <th>3</th>    </tr>    <tr>        <td>A</td>        <td>A</td>        <td>A</td>    </tr>    <tr>        <td rowspan="2">B</td>        <td>B1</td>        <td>B1</td>    </tr>    <tr>        <td>B2</td>        <td>B2</td>    </tr></table>

理想情况下,我希望它看起来像这样:

玩colspan并没有真正帮助,只是打破了东西.我尝试将每行的第一列的colspan设置为2,将B的一个设置为1,并且还有其他< td>对于B1和B2,没有用.

解决方法 最后,我有一个解决方案:

SNIPPET

.container {  background-color: #ccc;}thead{  background:#C9E4F4;}table,th,td {  text-align: center !important;  border: 1.5px solID #929292 !important;}#text1 {  background-color: #cac;}#text2 {  background-color: #cca;}#navigation {  background-color: #acc;}
<script src="http://cdnjs.cloudflare.com/AJAX/libs/twitter-bootstrap/2.1.0/bootstrap.min.Js"></script><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/CSS/bootstrap.CSS" rel="stylesheet" /><script src="https://AJAX.GoogleAPIs.com/AJAX/libs/jquery/2.1.1/jquery.min.Js"></script><table >  <tr>    <thead>      <th colspan="2">1</th>      <th>2</th>      <th>3</th>    </thead>  </tr>  <tr>    <td colspan="2">A</td>    <td>A</td>    <td>A</td>  </tr>  <tr>    <td rowspan="2">B</td>    <td>B1</td>    <td>B1</td>    <td>B1</td>  </tr>  <tr>    <td>B2</td>    <td>B2</td>    <td>B2</td>  </tr></table>
总结

以上是内存溢出为你收集整理的html – Bootstrap表 – 将行的列中的一个拆分两个全部内容,希望文章能够帮你解决html – Bootstrap表 – 将行的列中的一个拆分为两个所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1118408.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存