Solved

centering a script in a table

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
manage footer size 4 73
Looking for a solution or even half a solution for custom web portal 5 55
youtube blocking politics 4 58
PHP Curl to output a url 7 49
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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…

830 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