Solved

centering a script in a table

Posted on 2011-02-19
5
408 Views
Last Modified: 2013-11-19
i am having a problem centering script code in a table i thought that sourrounding it wiith the div would do it but to no avail. i am being caught under the gun in that i need to get this up fast. can someone help me please.  Code is attached for your review.
<p align="center">&nbsp;</p>

<table style="width: 100%" align="center">
				<tr>
<div> align="center""<td><script language="JavaScript" type="text/javascript" src="http://vhss-d.oddcast.com/vhost_embed_functions_v2.php?acc=1205860&js=1"></script><script language="JavaScript" type="text/javascript">AC_VHost_Embed(1205860,300,400,'',1,1, 1877501, 0,1,0,'246076811934de5db1b9d0041e29c9a9',9);</script>&nbsp;</td>
</div>
				</tr>
</table>

<p align="center">&nbsp;
<script language="JavaScript" type="text/javascript">
AC_VHost_Embed_19125(150,200,'FFFFFF',1,1,294734,0,0,0,'85123b62e58c080ca87302d044789231',6);
</script></p>

<p align="center">

Open in new window

0
Comment
Question by:masnee51
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:jfromanski
ID: 34932015
<td style="text-align:center;">
0
 
LVL 10

Assisted Solution

by:jfromanski
jfromanski earned 100 total points
ID: 34932019
and of course: <div> around <td> is an error (btw: you forget to close <div> tag)
0
 

Author Comment

by:masnee51
ID: 34932423
can u please give me the final  <div> command in its entirenty. each time the way i type it i get an error
0
 
LVL 6

Accepted Solution

by:
t-max earned 400 total points
ID: 34932478
As mentioned by jfromaski, you have some HTML errors there.
The code should look like this:
<p align="center">&nbsp;</p>

<table style="width: 100%" align="center">
				<tr>
<td>
<div align="center">
<script language="JavaScript" type="text/javascript" src="http://vhss-d.oddcast.com/vhost_embed_functions_v2.php?acc=1205860&js=1"></script>
<script language="JavaScript" type="text/javascript">AC_VHost_Embed(1205860,300,400,'',1,1, 1877501, 0,1,0,'246076811934de5db1b9d0041e29c9a9',9);</script>&nbsp;
</div>
</td>

				</tr>
</table>

<p align="center">&nbsp;
<script language="JavaScript" type="text/javascript">
AC_VHost_Embed_19125(150,200,'FFFFFF',1,1,294734,0,0,0,'85123b62e58c080ca87302d044789231',6);
</script></p>

<p align="center">

Open in new window


Note the following:
* in tables, content is always "inside" a cell (the TD tag). Your DIV was outside it.
* you had the string align="center" outside the DIV tag, but it must be a property of it.
* the align attribute of <div> (and also other elements) is deprecated, is not supported in HTML 4.01 Strict / XHTML 1.0 Strict DTD and will be probably be dropped in the future. You should use CSS syntax instead: <div style="text-align:center"> as mentioned above (either for "td" or "div" will work).
0
 

Author Closing Comment

by:masnee51
ID: 34932505
thank you so much
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now