Forum Moderators: open
<table width="458" align="right" border="0">
<tr>
<td><img src="fusion.jpg" /></td>
</tr>
<tr>
<td class="smallital" align="center">The basic process that takes place in thermonuclear fusion. Image is from <a href="http://www.example.org/page.html">http://www.example.org/page.html</a></td>
</tr>
</table>
this code does exactly what I want it do to in IE 6.0 - it aligns the table to the right and allows text to wrap around it. in Firefox, however, it leaves the table centered. I can align it to the right in firefox by adding:
style="margin-right:0px;"
as an attribute to the table, but the text still won't wrap. is there anyway to do this so that it works in both browsers? thanks in advance.
[edited by: tedster at 4:51 am (utc) on Nov. 28, 2004]
[edit reason] use example.org, remove specifics [/edit]
1. What DTD are you using?
2. Does your html validate [validator.w3.org]?
FYI, this example renders fine for me:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<head></head><body>
<table style="width:700px;margin:0 auto;">
<tr><td style="width:200px;"> </td>
<td valign="top" style="width:490px;"><table style="float:right;width:200px;">
<tr><td>Conceptualizing random endpoints in a access matrix provides reach extentions enterprise wide.</td></tr></table>Respective divisions historically insignificant, upscale trendlines in a management inventory analysis survivabilty format. Document-centric projections unfetter traditional auditing practices rivaling central process management. Advanced functionality, easy administration, proclaim the hallmarks of unprecedented opportunity.
</td></tr></table></body>
</html>
The HTML doesn't validate, it gets something like 22 errors. Most are either my failure to use "alt" attributes, which are evidently required, or somehow related to my lack of doctype declaration. Could this really be causing the problem?
Edit: the code you provided, tedster, works beautifully when I make simple test files with it (with no doctype declarations). Either this is getting messed up somehow by being inside another table centered with css, or maybe I have a syntax error or something? Geez, this is frustrating.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
If you've got nested tables, my bet is that you have some bad syntax somewhere - a missing tag or partial tag. The validator should help you spot it.
If it ends up being a complex rendering bug, having valid mark-up to begin with is the best way to zero in on the problem.
messed up somehow by being inside another table centered with css
That brings up another possibility as well - how are you centering the table? Centering can be a challenge, and FireFox is pretty standards compliant, so what works in IE may not in FF.
You may want to use the W3C CSS Validator [jigsaw.w3.org], and remember that text-align:center; means TEXT align, not non-text elements.
then the whole table is placed inside a div container with "text-align:center;". From what youre telling me, this could be the problem (text-align for text only), but i don't know of a way to center a table with css any other way.
thanks a lot for the help everyone.