[英]I am facing problem bootstrap table responsive
I am having some problem with bootstrap table responsive. 我在引导表响应方面遇到一些问题。
I have tried some code here https://codepen.io/arindamx01/pen/gJOqxK I need full tooltip visible. 我在这里尝试过一些代码https://codepen.io/arindamx01/pen/gJOqxK我需要完整的工具提示可见。 I have tried without .table-responsive
class. 我试过没有.table-responsive
类。 Without table responsive class it works well I mean I can see the tooltip by hovering on time. 没有表响应类,它会很好地工作,我的意思是我可以通过按时悬停看到工具提示。 but when I add .table-responsive
I can't see the total tooltip. 但是当我添加.table-responsive
时,看不到整个工具提示。 A long scroll appear in that table what should I have to do ... please help. 该表中出现长滚动条,我该怎么办...请帮助。 my expected ans like to be 我期望的是
Change following css to relative
to absolute
将跟随CSS更改为relative
对于absolute
.tooltipItem_dist {
position: absolute;
}
https://codepen.io/kashmiriguide/pen/gJOyjW https://codepen.io/kashmiriguide/pen/gJOyjW
您可以简单地使用bootstrap .table-responsive{-sm|-md|-lg|-xl}
断点 :
Please have a look at the below solution update your css accordingly. 请看看下面的解决方案相应地更新您的CSS。
.table-responsive { overflow-x: visible }
@media screen and (max-width: 767px) {
.table-responsive { overflow-y: visible }
}
The "problem" (notice the quote) is that by using .table-responsive
in your wrapper <div>
changes it's default overflow
behavior. “问题” (请注意引号)是通过在包装器<div>
使用.table-responsive
更改其默认overflow
行为。 So when your tooltip appears it gets trap inside your <div class="table-responsive">
wrapper. 因此,当您的工具提示出现时,它会陷在<div class="table-responsive">
包装器中。 To solve this just set the overflow: visible;
为了解决这个问题,只需设置overflow: visible;
to it. 对此。
About possible implications, well you will lose the ability to scroll horizontally on mobile, in that case you can write media query to restore the functionality on mobile devices, because you will not need the tooltip
on a mobile anyway. 关于可能的影响,那么您将失去在移动设备上水平滚动的能力,在这种情况下,您可以编写媒体查询来恢复移动设备上的功能,因为无论如何您都不需要在移动设备上使用tooltip
。
https://codepen.io/jose-guzman-ojeda/pen/wbvZEp https://codepen.io/jose-guzman-ojeda/pen/wbvZEp
Try these solutions 试试这些解决方案
Method 1: 方法1:
.tooltipItem_dist{
position: absolute;
}
It will be positioned related directly to the HTML element (the page itself). 它的位置将直接与HTML元素(页面本身)相关。
An important thing to keep in mind while using absolute positioning is to make sure it is not overused, otherwise, it can lead to a maintenance nightmare. 使用绝对定位时要记住的重要事项是确保它不会过度使用,否则会导致维护噩梦。
Method 2: 方法2:
.table-responsive{
overflow: visible;
}
I will go with method 2. 我将使用方法2。
你有尝试添加元视口吗?
<meta name="viewport" content= "width=device-width, initial-scale=1.0">
.tooltipItem_dist:hover .tooltipItem { visibility: visible; opacity: 1; } .tooltipItem_dist{ position: relative; } .tooltipItem_dist .tooltipItem { top: 100%; } .tooltipItem { color: #fff; position: absolute; top: calc(100% - 30px); width: 160px; background: #333; z-index: 1; text-align: center; padding: 10px; border-radius: 16px; -moz-border-radius: 16px; -webkit-border-radius: 16px; left: 50%; transform: translate(-50% , 0); -moz-transform: translate(-50% , 0); -webkit-transform: translate(-50% , 0); opacity: 0; visibility: hidden; -webkit-transition: all 300ms ease-in-out; -moz-transition: all 300ms ease-in-out; -ms-transition: all 300ms ease-in-out; -o-transition: all 300ms ease-in-out; transition: all 300ms ease-in-out; }
<div class="table table-striped table-bordered dt-responsive nowrap"> <table class="table table-hover noMargin arUinqueteable"> <thead> <tr> <th>POS</th> <th>NAME</th> <th>AV PACE</th> <th>TIME</th> <th> </th> <th> </th> </tr> </thead> <tbody class="results_section"> <tr class="resultTotalTr "> <!--log_user_active--> <td class="blue">1</td> <td class="blue">Subha Dev <!--1--><!--Limpopo--></td> <td class="blue">00:07:23</td> <td class="black tooltipItem_dist">04:04:04 <div class="tooltipItem"> <ul> <li><span>SWIM</span> 04:23:04</li> <li><span>T1</span> sdfsdf</li> <li><span>BIKE</span></li> <li><span>T2</span></li> <li><span>RUN</span></li> <li><span>TOTAL</span></li> </ul> </div> </td> <td><!--<span>PB</span>--></td> <td><!--<i class="fa fa-check-circle-o"></i>--></td> </tr> <tr class="resultTotalTr "> <!--log_user_active--> <td class="blue">2</td> <td class="blue">Subha Dev <!--1--><!--Limpopo--></td> <td class="blue">00:09:43</td> <td class="black tooltipItem_dist">05:21:01 <div class="tooltipItem"> <ul> <li><span>SWIM</span> 04:23:04</li> <li><span>T1</span> sdfsdf</li> <li><span>BIKE</span></li> <li><span>T2</span></li> <li><span>RUN</span></li> <li><span>TOTAL</span></li> </ul> </div> </td> <td><!--<span>PB</span>--></td> <td><!--<i class="fa fa-check-circle-o"></i>--></td> </tr> <tr class="resultTotalTr "> <!--log_user_active--> <td class="blue">3</td> <td class="blue">Subha Dev <!--1--><!--Limpopo--></td> <td class="blue">00:18:56</td> <td class="black tooltipItem_dist">10:25:01 <div class="tooltipItem"> <ul> <li><span>SWIM</span> 04:23:04</li> <li><span>T1</span> sdfsdf</li> <li><span>BIKE</span></li> <li><span>T2</span></li> <li><span>RUN</span></li> <li><span>TOTAL</span></li> </ul> </div> </td> <td><!--<span>PB</span>--></td> <td><!--<i class="fa fa-check-circle-o"></i>--></td> </tr> </tbody> </table> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.