Solved

centering a script in a table

Posted on 2011-02-19
5
410 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.  …
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

919 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