Css 如何在引导表中创建下拉选项<;th>;
我正试图在表格标题中这样做-Css 如何在引导表中创建下拉选项<;th>;,css,bootstrap-table,Css,Bootstrap Table,我正试图在表格标题中这样做- <ul class="dropdown-menu" id="dropEmail" style="position:relative; z-index: 99999;"> <li><a href="#">HTML</a></li> <li><a href="#">CSS</a>
<ul class="dropdown-menu" id="dropEmail" style="position:relative; z-index: 99999;">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
<table id="example3" class="table table-bordered table-striped" style=" overflow-x: scroll;" >
<thead>
<tr>
<th></th>
<th class="dropdown"> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Messages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Inbox</a></li>
<li><a href="#">Drafts</a></li>
<li><a href="#">Sent Items</a></li>
<li class="divider"></li>
<li><a href="#">Trash</a></li>
</ul>
</th>
</tr>
</thead>
<tbody >
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
下拉示例
<ul class="dropdown-menu" id="dropEmail" style="position:relative; z-index: 99999;">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
<table id="example3" class="table table-bordered table-striped" style=" overflow-x: scroll;" >
<thead>
<tr>
<th></th>
<th class="dropdown"> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Messages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Inbox</a></li>
<li><a href="#">Drafts</a></li>
<li><a href="#">Sent Items</a></li>
<li class="divider"></li>
<li><a href="#">Trash</a></li>
</ul>
</th>
</tr>
</thead>
<tbody >
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
但是,在前端屏幕中,下拉菜单会显示在表体的后面。将z-index设置为9999和position-relative不起作用。如果将消息锚定标记替换为:
<ul class="dropdown-menu" id="dropEmail" style="position:relative; z-index: 99999;">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
<table id="example3" class="table table-bordered table-striped" style=" overflow-x: scroll;" >
<thead>
<tr>
<th></th>
<th class="dropdown"> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Messages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Inbox</a></li>
<li><a href="#">Drafts</a></li>
<li><a href="#">Sent Items</a></li>
<li class="divider"></li>
<li><a href="#">Trash</a></li>
</ul>
</th>
</tr>
</thead>
<tbody >
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<a class="dropdown-toggle" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Messages</a>
您是否有任何自定义css覆盖优先于引导?如果是,请发布css规则。位置:表格单元格上的相对位置可能有问题;建议您在单元格内使用一个额外的容器元素,并定位该相对元素,以便它可以为要定位在z轴上的下拉列表设置适当的上下文。在codeply中,即使没有'style=“position:relative;z-index:99999;”也可以正常工作
<ul class="dropdown-menu" id="dropEmail" style="position:relative; z-index: 99999;">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
<table id="example3" class="table table-bordered table-striped" style=" overflow-x: scroll;" >
<thead>
<tr>
<th></th>
<th class="dropdown"> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Messages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Inbox</a></li>
<li><a href="#">Drafts</a></li>
<li><a href="#">Sent Items</a></li>
<li class="divider"></li>
<li><a href="#">Trash</a></li>
</ul>
</th>
</tr>
</thead>
<tbody >
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>