您似乎想创建一个具有固定宽度和高度的表格,并使其在移动设备上水平滚动。我注意到你正在使用 tailwind CSS 类来设计你的表格。要实现所需的行为,您可以对代码进行以下更改:
<div class="table-wrp block min-h-96 overflow-x-auto">
<table class="w-full">
<!-- Your table content goes here -->
</table>
</div>
<div class="table-wrp block min-h-96 overflow-x-auto">
<table class="w-full">
<thead class="bg-white border-b sticky top-0">
<tr>
<th bgcolor="#45abe0" class="p-4 text-xs font-bold text-white text-center">TRACK 1</th>
<th bgcolor="#ff661b" class="p-4 text-xs font-bold text-white text-center">TRACK 2</th>
<th bgcolor="#0099a8" class="p-4 text-xs font-bold text-white text-center">TRACK 3</th>
<th bgcolor="#00539f" class="p-4 text-xs font-bold text-white text-center">TRACK 4</th>
<th bgcolor="#76bc21" class="p-4 text-xs font-bold text-white text-center">TRACK 5</th>
</tr>
</thead>
<tbody>
<tr>
<td bgcolor="#74c0e8" class="p-4 text-xs font-bold text-white text-center">
<h4>Getting Help Early</h4>
</td>
<td bgcolor="#ff8c54" class="p-4 text-xs font-bold text-white text-center">
<h4>Getting the Best Possible Care </h4>
</td>
<td bgcolor="#40b2be" class="p-4 text-xs font-bold text-white text-center">
<h4>Getting Diverted from Justice System Involvement</h4>
</td>
<td bgcolor="#407eb7" class="p-4 text-xs font-bold text-white text-center">
<h4>Research Updates</h4>
</td>
<td bgcolor="#9bcd61" class="p-4 text-xs font-bold text-white text-center">
<h4>Youth Voices</h4>
</td>
</tr>
<!-- Additional table rows here -->
</tbody>
</table>
</div>
<head>
<!-- Other meta tags and stylesheets -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
通过这些更改,您的表格应该具有固定的宽度和高度,并且可以在移动设备上水平滚动。