如何通过表格单元裁剪图像?

时间:2018-04-02 14:21:13

标签: html css

我的桌子里面有图片:

<!DOCTYPE html>
<html>
<head>
<style>
body {
    font-family: TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif
}

table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
    table-layout:fixed;
    width:800px;
}
th, td {
    padding: 15px;
    text-align: left;
}
td#tdimg{
    height: 500px;
}
</style>
</head>
<body>

<h2>Styling Tables111</h2>


<table>
  <tr>
    <td colspan="3" id="tdimg"><img src="file://C:\Users\max\AppData\Local\Temp\ec531b56-e9a8-4fa7-bec6-e56a3c90251d.bmp" alt=""></img></td>
  </tr>
  <tr>
    <th>Firstname</th>
    <th>Lastname</th> 
    <th>Age</th>
  </tr>
</table>

</body>
</html>

我的桌子有宽度:

width:800px;

我的图片尺寸:1500 * 2200px

如何通过<td>边界裁剪图像?

0 个答案:

没有答案