如何使表格单元格高度相等而不使一个单元格上的图像超出表格?

问题描述 投票:0回答:1
html css css-tables
1个回答
0
投票

<table style="table-layout: fixed; width: 100%;">
  <tr>
    <td style="width: 50%;">
      <img src="https://picsum.photos/500" alt="Example Image" style="width: 100%; height: auto;" />
    </td>
    <td style="width: 50%; text-align: center;">
      <p>hhhh placeholder hhhh</p><p>hhhh placeholder hhhh</p><p>hhhh placeholder hhhh</p><p>hhhh placeholder hhhh</p>
    </td>
  </tr>
</table>

© www.soinside.com 2019 - 2024. All rights reserved.