我正在尝试制作一个具有固定布局的表格:每个单元格都有一个预定义的高度,如果单元格内有额外的信息,那么应该有一个滚动条。提前声明每个单元格的高度非常重要。但是,据我所知,它完全忽略了行和单元格高度上的(非常强调的)方向。它不断为<tr>
和<td>
添加额外的空间,以确保它可以显示全部内容。如何使其停止?
<table border="1" style="table-layout:fixed; height:400px; width:500px;">
<tr style="height:50px; min-height:50px; max-height:50px;">
<td style="height:50px; min-height:50px; max-height:50px; overflow-y:scroll;">
<div style="height:500px; background-color:#fdc;">abc<br/>abc<br/>abc<br/>abc</div>
</td>
</tr>
<tr style="height:350px; min-height:350px; max-height:350px;">
<td style="height:350px; min-height:350px; max-height:350px; overflow-y:scroll;">
<div style="height:200px; background-color:#cdf;">abc<br/>abc<br/>abc<br/>abc</div>
</td>
</tr>
</table>
谢谢。