Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript distorts table width

Status
Not open for further replies.

Thrakazog

Programmer
Dec 10, 2001
48
US
I need to pull some javascript content into my website and put it in a html table. The problem is that when I do this the javascript completely distorts the table width. I can't change the code in the script I'm getting. How can I prevent the javascript from changing my table width?

Thanks.
 
Doc, my head hurts. Gimme some medicine"

It can be everything... Example please
 
My table setup looks like this. The content from the Javascript is only about 250 pixels across. However the table width comes up over 1000 pixels wide when the javascript is included. The javascript content still shows up as 250 pixels across with a ton of empty space on each side. With the Javascript removed the table shows up 500 pixels wide like it should. I need a way to force the table to stay at 500px with the javascript.

<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="500px" border="0">
<TR>
<TD align="center">
<script type="text/javascript" src=" </script>
</TD>
</TR>
<TR>
<TD align="center">
Some words
</TD>
</TR>
</table>
 
External .js file probably generates document.write() output. As you sait it can't be changed, so try this:


Code:
<td align="center">
<div style="width: 500px; overflow-x: hidden;">
	<script type="text/javascript" src="blah.js">
	</script>
</div>
</td>
 
I find it hard to believe your javascript only produces content 250px wide... If it did so, your table should display as intended.

Can you show us the JS, or at very least, the *exact* output it produces?

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top