...

View Full Version : Centering an image generated by a javascript!



busin3ss
04-25-2006, 10:57 PM
HI! I'm going INSANE! I just can't figure out this, and I've been stuck in this small detail for days...!

I want to center with CSS an image generated by a java script!

I have a contact form in HTML with a CAPTCHA verification, so in the head I include the java script needed to generate the image:


<script type="text/javascript" src="includes/jcap.js"></script>

Then, in the form I add this cell where the image that is generated by the java script is displayed:


<td colspan="2"><script type="text/javascript">cimg()</script></td>


So at last, in the java script invoked at the head, it does this to display the image in the HTML:


document.write('<img src="'+imgdir+imgid+'.gif" width=240 height=80 alt="Captcha Image" /></a>');

So, I have tryed many ways, and I can't seem to find a way to center the imaged generated by the java script... So, any suggestion? Thanks in advanced!

djm0219
04-25-2006, 11:30 PM
Perhaps this will help.



<td colspan="2" style="text-align: center;"><script type="text/javascript">cimg()</script></td>

busin3ss
04-26-2006, 03:35 AM
Hi!

I found the issue, I had a float:left in the style sheet so the image went to the left all the time, thanks a lot!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum