Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

centering a script in a table

Posted on 2011-02-19
5
Medium Priority
?
434 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 400 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 1600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

885 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