P粉4784456712023-07-25 14:53:20
To solve this problem, you can add an extra wrapping div around the table and apply the overflow-hidden rounded-lg class to that wrapping div, not the table itself
<div class="w-50 m-auto">
<div class="overflow-hidden rounded-lg">
<table class="w-full font-inter text-left border-collapse">
<thead>
<tr class="bg-[#f2f4f7]">
<th class="p-3 text-gray-500 text-xs font-semibold leading-none border border-gray-200"><span class="inline-flex gap-1">Plan</span></th>
<th class="p-3 text-gray-500 text-xs font-semibold leading-none border border-gray-200"><span class="inline-flex gap-1">No. of Subscription</span></th>
</tr>
</thead>
<tbody>
<tr>
<td class="border border-gray-200 p-3">Silver plan USD Monthly</td>
<td class="border border-gray-200 p-3">2</td>
</tr>
</tbody>
</table>
</div>
</div>```
通过将表格包裹在一个div中,并将overflow-hidden rounded-lg类应用于该div,您应该可以保持圆角的同时保留角边框。