我需要在不影响<tbody>
内部内容的情况下自动刷<thead>
,但是在实现它时遇到了问题。我无法放置swiper-wrapper
类,因为HTML不允许<div>
标签放在表中,并且Swiper.js本身不允许swiper-wrapper
与swiper-slide
类内联,因为它将破坏布局。
有什么解决办法吗?请看一下我的代码。
<div class="table-responsive">
<table class="table table-auto-swiped">
<thead>
<!-- there will be 5 <th> element inside this tag -->
</thead>
<tbody class="swiper-wrapper swiper-slide font-weight-bold">
<!--
there will be 10 rows of data to display for each swiper-slide class
and it will be swiped using autoplay feature provided by Swiper.
but it does not allow swiper-slide class to be inlined with the
swiper-wrapper class, the layout will be messed up.
-->
</tbody>
</table>
</div>
<script>
var autoSwipeTable = new Swiper.default('.table-auto-swiped', {
//
})
</script>