在表格中显示时缩小图像(make the image smaller while displaying in a table)
如何在html中以小尺寸显示图像
假设我以这种方式显示图像---
<td> <a href="//your link//"><img src="//image url//"></a> </td>但是图像显示得如此之大,我如何控制图像大小并使其变小。
how to display image in a small size in html
Suppose i am displaying the images in this way ---
<td> <a href="//your link//"><img src="//image url//"></a> </td>But the image is displaying so big, how can i control the image size and make it small.
最满意答案
简单地设置高度和宽度
<img height="120px" width="120px" src="{{ data.image_url }}">但我相信最好的做法也是设置它,如果它被defined ,它应该显示其他default动作
<td> {% if data.image_url is defined %} <img height="120px" width="120px" src="{{ data.image_url }}"></a> {% else %} </td>{% endif %}Set the height and width simply
<img height="120px" width="120px" src="{{ data.image_url }}">But i belive the best practise will be also to set it like if it is defined than it should show else a default action
<td> {% if data.image_url is defined %} <img height="120px" width="120px" src="{{ data.image_url }}"></a> {% else %} </td>{% endif %}更多推荐
发布评论