如何解决粘性标题但没有滚动内容/正文
我正在尝试实现一个带有粘性标题但没有滚动体的表格。我尝试了以下几个链接,但看起来并没有解决问题。
CSS-Only Scrollable Table with fixed headers
Fixed header and scrollable body
bootstrap sticky footer but no scroll content
我正在使用 bootstrap 3 和 jquery 及其非常简单的动态构建表。
应用词缀类后,它在屏幕上显示固定标题,但格式不正确(请参阅附件和下面的代码)。
<table class="table table-bordered">
<g:if test="${validityAttribute}">
<thead class="affix">
<tr>
<th style="width: 20%;"> </th>
<g:each in="${answersHeader}" status="gai" var="answers">
<th style="width:${80 / answersHeader?.size()}%;text-align: center;">
${answers}
</th>
</g:each>
</tr>
</thead>
</table>
CSS:
.affix {
position: fixed;
z-index: 900;
padding-top: 3px;
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
width: 100%;
}
enter code here
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。