/    Sign up×
Community /Pin to ProfileBookmark

Image not centering in IE

[code]<img src=’http://sm.jcink.com/images/forum/ipbalt/stats.gif’ border=’0′ alt=’Board Stats’ style=’display:block;margin-left:auto;margin-right:auto;’ />[/code]

Now I have that and its inside a TD and it refuses to center. And I am trying to make it all by CSS and not using <center> and crap but it refuses to center not matter what I try to do with it.

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@6StringGeekFeb 12.2009 — see below...accidentally posted twice.
Copy linkTweet thisAlerts:
@6StringGeekFeb 12.2009 — &lt;img src='http://sm.jcink.com/images/forum/ipbalt/stats.gif' border='0' alt='Board Stats' style='display:block;margin-left:auto;margin-right:auto;' /&gt;

Now I have that and its inside a TD and it refuses to center. And I am trying to make it all by CSS and not using <center> and crap but it refuses to center not matter what I try to do with it.[/QUOTE]


Did you specify a width for the table...like 100%? Also, what does the div say? It could be affecting the alignment as well. Post all the code. Maybe we can also point you towards the easy way to do it all in css vice tables...

your example centers for me:

[CODE]<table width="100%">
<tr><td>
<img src='http://sm.jcink.com/images/forum/ipbalt/stats.gif' border='0' alt='Board Stats'
style='display:block;margin-left:auto;margin-right:auto;' />
</td></tr></table>[/CODE]
Copy linkTweet thisAlerts:
@posiden5665authorFeb 12.2009 — &lt;table cellpadding='4' cellspacing='1' border='0' width='100&amp;#37;'&gt;
&lt;tr&gt;
&lt;td class='row2' width='5%' valign='middle'&gt;&lt;img src='http://sm.jcink.com/images/forum/ipbalt/user.gif' border='0' alt='Active Users' style='display: block;margin: 0px auto;'/&gt;&lt;/td&gt;
&lt;td class='row4' width='95%'&gt;&lt;b&gt;&lt;/b&gt; No members are celebrating a birthday today&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


And the css specifying row2 and row4 is just setting a bg color
Copy linkTweet thisAlerts:
@CoyotelabFeb 12.2009 — [code=html] <table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<div align="center">
<td class="row2" width="5%" valign="middle">
<img src="http://sm.jcink.com/images/forum/ipbalt/user.gif" border="0" alt="Active Users">
</td>
</div>
<td class="row4" width="95%">No members are celebrating a birthday today<br /></td>
</tr>
</table>[/code]
Copy linkTweet thisAlerts:
@FangFeb 12.2009 — &lt;img src='http://sm.jcink.com/images/forum/ipbalt/stats.gif' border='0' alt='Board Stats' style='display:block;margin-left:auto;margin-right:auto;' /&gt;

Now I have that and its inside a TD and it refuses to center. And I am trying to make it all by CSS and not using <center> and crap but it refuses to center not matter what I try to do with it.[/QUOTE]
Give the image a width
×

Success!

Help @posiden5665 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...