javascript – 带有Font-Awesome和表格的工具提示
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了javascript – 带有Font-Awesome和表格的工具提示,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2110字,纯文字阅读大概需要4分钟。
内容图文
我正在尝试使用title属性将一个工具提示添加到table-cell内的图标.工具提示似乎在图表外面工作正常,但在表格内部却无法正常工作.
以下是js-fiddle:
https://jsfiddle.net/amahajan/7vyhzgod/1/
<td><div>D</div>
<div class="lock-posn"><i class="fas fa-eye fa-sm"></i></div>
<div class="mis-match"><a href="#" title ="Warning"><i class="fas fa-exclamation-triangle fa-sm"></i></a></div>
</td>
请让我知道如何处理这个问题.
谢谢
解决方法:
更改.lock-posn和.mis-match的css,由于position:absolute,它没有显示标题工具提示
table {
border-collapse: collapse;
float: left;
font-size: 12px;
table-layout: auto;
overflow-x: scroll;
overflow-y: scroll;
position: absolute;
top: 75px;
}
thead th{
position: sticky;
position: -webkit-sticky;
top: 75px;
z-index: 3;
background-color: rgba(255, 255, 255, 1);
border-top-style: none;
border-left-style: none;
border-right-style: none;
border-bottom-style: solid;
border-width: thin;
border-bottom-color: grey;
background-clip: padding-box;
white-space: nowrap;
min-width: 100px;
height: 50px;
min-height: 50px;
max-height: 50px;
text-align: center;
overflow-x: hidden;
}
tbody td {
border-collapse: collapse;
border-style: solid;
border-width: thin;
border-color: grey;
white-space: nowrap;
text-align: center;
min-width: 100px;
height: 50px;
min-height: 50px;
max-height: 50px;
overflow-x: scroll;
z-index: -1;
overflow-x: hidden;
position: relative;
}
#opt-staff-table th.opt-staff-sticky-col {
position: sticky;
position: -webkit-sticky;
left: 0;
top: 75px;
z-index: 4;
}
.lock-posn {
width: 48%;
display: inline-block;
text-align: right;
}
.mis-match {
display: inline-block;
text-align: left;
width: 48%;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" />
<a href="#" title="Show the previous 4 weeks"><i class="fas fa-chevron-left"></i></a>
<table>
<thead>
<tr>
<th>Day1</th>
<th>Day2</th>
</tr>
</thead>
<tbody>
<tr>
<td><div>D</div>
<div class="mis-match"><a href="#" title ="Warning"><i class="fas fa-exclamation-triangle fa-sm"></i></a></div>
<div class="lock-posn"><i class="fas fa-eye fa-sm"></i></div>
</td>
<td><div>E</div></td>
</tr>
<tr>
<td><div>N</div></td>
<td><div>A</div></td>
</tr>
</tbody>
</table>
内容总结
以上是互联网集市为您收集整理的javascript – 带有Font-Awesome和表格的工具提示全部内容,希望文章能够帮你解决javascript – 带有Font-Awesome和表格的工具提示所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。