html-TailwindCSS中带有粘性标题和圆角的表格
发布时间:2022-05-11 19:42:16 304
相关标签: # css
我很难在 TailwindCSS 中获得带有粘性标题和圆角的表格。
我有粘性标题,但是一旦我隐藏了角落的溢出,粘性标题就不再起作用,反之亦然。
保留overflow-x-auto并overflow-hidden保持圆角但删除粘性定位:
https://play.tailwindcss.com/VsjHVVmKQr
移除overflow-x-auto并overflow-hidden保持粘性定位但移除圆角:
https://play.tailwindcss.com/SDqMXQ3f0a
<div class="px-4 sm:px-6 lg:px-8">
<div class="mt-8 flex flex-col">
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
<table class="min-w-full divide-y divide-gray-300">
<thead class="bg-indigo-500 sticky top-0">
<tr>
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white sm:pl-6">First name</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-white">Last name</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-white">Email</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-indigo-200 bg-white">
<!-- More rows... -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报