在CSS中的表td中居中图像 [英] Center image in table td in CSS
本文介绍了在CSS中的表td中居中图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在尝试将图像对齐到表td的中心。
I've been trying to align an image to the center of the table td. It worked with setting margin-left to a specific value but it also increased the size of td too and that isn't exactly what I wanted
有没有什么有效的方法这样做?我使用了表格高度和百分比的百分比。
Is there any efficient ways of doing this? I used percentages for the height and witdh of the table.
推荐答案
<td align="center">
或通过css,这是首选方法...
or via css, which is the preferred method any more...
<td style="text-align: center;">
这篇关于在CSS中的表td中居中图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文