Solved

centering a script in a table

Posted on 2011-02-19
5
418 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Link failure 16 89
JS to redirect to prev page 8 44
.CSS HTML Help 3 55
Wordpress contact form sending spam 2 50
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
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 count occurrences of each item in an array.

737 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