Whenever I place an image in a table cell the image never takes up the whole cell(example below)
and you can see the cell's background. I've tried adjusting the height of the image and padding of the cell.
Any help is greatly appreciated.
每当我将图像放在表格单元格中时,图像就不会占据整个单元格(例如下面的例子),您可以看到单元格的背景。我已经尝试调整图像的高度和单元格的填充。任何帮助是极大的赞赏。
<td rowspan="7"><img src=. alt=. /><td>
1 个解决方案
#1
0
Try this:
img{
vertical-align: top;
}
td{
padding:0;
margin:0;
}
Check JSFiddle Demo
You can see in demo that red background doesn't appear and image take up the whole cell.
检查JSFiddle演示您可以在演示中看到红色背景没有出现,图像占据整个单元格。
#1
0
Try this:
img{
vertical-align: top;
}
td{
padding:0;
margin:0;
}
Check JSFiddle Demo
You can see in demo that red background doesn't appear and image take up the whole cell.
检查JSFiddle演示您可以在演示中看到红色背景没有出现,图像占据整个单元格。