我这个图片为什么不居中,怎样让它居中?

来源:百度知道 编辑:UC知道 时间:2024/06/23 21:38:31
strRsp = strRsp & ("<table width=""100%""><tr><td width=""850"" height=""42"" width=""100%""><img src=""images/a1.jpg"" width=""850"" height=""42"" /></td></tr><tr align=""center"" width=""100%""><td align=""center"" width=""478"" height=""421"" width=""100%""><img align=""center"" src=""images/qa1.jpg"" width=""478"" height=""421"" /></td></tr><tr><td><h2> Take a News Break! Follow the round-up of happenings, events and articles by colleagues at the Headquarters.</h2></td></tr></table>" & vbNewLine)

就是 images/qa1.jpg这个 。

img
{
margin:0 auto;
}

<table align=center width=100% >

楼主的表格代码太乱。。。 src=""images/qa1.jpg"" 用了""""这样的

正确的表达式是:src="images/qa1.jpg",你写错了,可能会引起网页显示错误。。。 楼主还是理理你的表格嵌套。。。。表格没嵌套好,很难让图片居中
-----------------------------------------------------------

正确的表格居中是

<table width="200" border="1">
<tr>
<td align="center" ><img src="1.jpg" width="34" height="34" /></td>
</tr>
</table>

只要给 td 或者 tr 设置align="center",也就是居中的意思,就行了