Solved

Table column widths are different on the web than what is specified in sourc code.

Posted on 2007-12-06
12
193 Views
Last Modified: 2010-04-07
Please take a look at this link: http://designamania.com/DesertSands/DesertSands.htm
As you can see from the source code, all three columns are coded to be 250 px wide. And yet when I insert an SWF file in the middle square, it distorts the width of the column.
What's causing that, and how do I fix it?

Thanks!
John
0
Comment
Question by:gabrielPennyback
  • 7
  • 5
12 Comments
 
LVL 11

Expert Comment

by:dodge20
ID: 20430437
The reason it is doing this, is because you don't have your cellspacing set to 0 so the cell space is taking up 1px so you are calling for more space than you have.

You have 3 options
either change
<table width="750" height="388" border="0" cellpadding="0">
to
<table width="750" height="388" border="0" cellpadding="0" cellspacing="0">

Or
Remove the width="250" from the middle cell of your table (the one that contains the flash) With your other 2 being set to 250, the middle cell will take up the remaining space.

Or Make your table width larger. (Worst option).
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20435091
Hi dosge20,

Thanks! I thought that would do it but i tried all three and none of them worked. Obviously I'm doing something wrong. Could you replace rewrite all the table code attached below so that it will work?

Thanks,

John
    <tr>

      <th width="250" height="168" scope="col">Something here </th>

      <th width="250" scope="col"><div align="center">

        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="211" height="144">

            <param name="movie" value="Desert Tween.swf">

            <param name=quality value=high>

            <embed src="Desert Tween.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="211" height="144"></embed>

        </object>

      </div></th>

      <th width="250" scope="col">Something here </th>

    </tr>

Open in new window

0
 
LVL 11

Expert Comment

by:dodge20
ID: 20435487


Option 1

--------------------------------------

<table width="750" height="388" border="0" cellpadding="0" cellspacing="0">

    <tr bgcolor="#FF9900">
 

      <th height="48" colspan="3" scope="col"><div align="right"><span class="style6">desert sands</span></div></th>

    </tr>

    <tr>

      <th width="250" height="168" scope="col">Something here </th>

      <th width="250" scope="col"><div align="center">

        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="211" height="144">

            <param name="movie" value="Desert Tween.swf">

            <param name=quality value=high>
 

            <embed src="Desert Tween.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="211" height="144"></embed>

        </object>

      </div></th>

      <th width="250" scope="col">Something here </th>

    </tr>

    <tr bgcolor="#FFFFFF">

      <td colspan="3"><div align="justify">

        <blockquote>
 

          <p><span class="style2">All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up. All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.</span></p>

        </blockquote>

      </div></td>

    </tr>

  </table>
 
 

Option2

--------------------------

<tr>

      <th width="250" height="168" scope="col">Something here </th>

      <th scope="col"><div align="center">

        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="211" height="144">

            <param name="movie" value="Desert Tween.swf">

            <param name=quality value=high>
 

            <embed src="Desert Tween.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="211" height="144"></embed>

        </object>

      </div></th>

      <th width="250" scope="col">Something here </th>

    </tr>

Open in new window

0
 
LVL 11

Expert Comment

by:dodge20
ID: 20435513
Actually after looking closer, I don't think your table code is correct. You have your colspan in the th and not the td Try this.
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr bgcolor="#FF9900">

    <td colspan="3"><div align="right"><span class="style6">desert sands</span></div></td>

  </tr>

  <tr>

    <td width="250" height="168"><div align="center">Something here</div></td>

    <td width="250"><div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="211" height="144">

              <param name="movie" value="Desert Tween.swf">

              <param name=quality value=high>

        

            <embed src="Desert Tween.swf" width="211" height="144" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>

    </object></div></td>

    <td width="250"><div align="center">Something here</div></td>

  </tr>

  <tr>

    <td colspan="3"><span class="style2">All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up. All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.</span></td>

  </tr>

</table>

Open in new window

0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20435562
I still can't get it to work. in preview Could you please take a look at my source code again and then - because I am so dense  - could you correct the entire code for me?

Thanks,

John
0
 
LVL 11

Expert Comment

by:dodge20
ID: 20435624
No problem - you aren't dense, i did make a mistake on my initial response.

See if this page code works for you.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Untitled Document</title>

<style type="text/css">

<!--

.style2 {

	font-family: "Gill Sans MT";

	margin-right: 0px;

	margin-left: 0px;

}

.style6 {

	font-family: "Monotype Corsiva";

	color: #FFFFFF;

	font-size: 36px;

	padding-right: 40px;

}

-->

</style>

</head>
 

<body>

<p>&nbsp;</p>

<p>&nbsp;</p>

<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr bgcolor="#FF9900">

    <td colspan="3"><div align="right"><span class="style6">desert sands</span></div></td>

  </tr>

  <tr>

    <td width="250" height="168"><div align="center">Something here</div></td>

    <td width="250"><div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="211" height="144">

              <param name="movie" value="Desert Tween.swf">

              <param name=quality value=high>

        

            <embed src="Desert Tween.swf" width="211" height="144" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>

    </object></div></td>

    <td width="250"><div align="center">Something here</div></td>

  </tr>

  <tr>

  

    <td colspan="3"><blockquote><div align="justify"><span class="style2">All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up. All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.All across the world, winds blow and the sun beats down and rain doesn't rain and what little moisture there is disappears. .Deserts grow. Trees vanish. Streams dry up.</span></div></blockquote></td>

  </tr>

</table>

</body>

</html>

Open in new window

0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20439013
You won't believe it but it turns out that the problem is the merged cell in the third row! This is not a problem with a single line of text, but it becomes a problem as soon as the text wraps to a second line! Have you ever encountered this before? For that matter do you encounter it when you publish an html doc with my code? Is it a bug in Dreamweaver MX2004?
The workaround of course is to create a second single column table underneath the first table, but is there a way to fix the "merged-cell-wrap-text" problem directly.

Thanks,
John
0
 
LVL 11

Expert Comment

by:dodge20
ID: 20441456
I was testing it in firefox and everything seemed fine. I just tested it in Internet explorer and saw the problem you were talking about. My guess is that it is because MX 2004 doesn't embed the flash correctly and IE does something to throw off the look of the site. Take a look at this article - it shows how to correctly embed flash for IE

http://www.adobe.com/devnet/activecontent/articles/devletter.html

Once it is correctly embedded, let us know what the result is.
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20455012
I love the proposed solution, and I will definitely accept it,  but it seems to address another important issue even more.  I tried applying the "External JavaScript solution 1: For single (or few) occurrences of embedded content" to another simpler document containing no tables, just one SWF, and I couldn't get it to work.
There are too many things I don't understand, so could you please rewrite the code below with the changes recommended in JavaScript solution1, so that it will produce the desired results?
Also please tell me exactly what external files need to be where, and what they should be called for everything to work.


If you could do that, I think I'd be able to start understanding how it works.

Thanks!

John
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>JC Portfolio</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

//-->

</script>

<style type="text/css">

<!--

body {

	background-color: #000000;

	background-repeat: repeat-x;

}

-->

</style>

</head>	
 

<div align="center">

  <p>&nbsp;</p>

  <p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="720" height="540">

      <param name="movie" value="../Brick%20Wall.swf">

      <param name=quality value=high>

      <embed src="../Brick%20Wall.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="540"></embed>

    </object>

  </p>

</div>

</body>

</html>

Open in new window

0
 
LVL 11

Accepted Solution

by:
dodge20 earned 500 total points
ID: 20457308
It would be something like this (your swf and js file are located in the same directory as your html page.

Your foo.js page would look like this
function RunFoo()
{
   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="720" height="540">\n');
   document.write('<param name="movie" value="Brick%20Wall.swf" />\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<embed src="Brick%20Wall.swf" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="540"></embed>\n');
   document.write('</object>\n');
}

Also a tip - don't use spaces when naming files. You is it puts in a %20 for the space. Not all browsers will read this. I would name it BrickWall.swf and adjust the file name accordingly.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>JC Portfolio</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

//-->

</script>

<script src="foo.js" type="text/javascript"></script>

<style type="text/css">

<!--

body {

	background-color: #000000;

	background-repeat: repeat-x;

}

-->

</style>

</head>	

 

<div align="center">

  <p>&nbsp;</p>

  <p>

<script type="text/javascript">RunFoo();</script>

    </object>

  </p>

</div>

</body>

</html>

Open in new window

0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20458846
It's starting to make sense to me, but I must still be missing something, because when I preview in my browser I get a blank page.  Here's what I've got:

1) I created a javascript file, and copied and pasted your script into it.
2) I replaced my html code with your code.
3) I changed "Brick Wall.swf" to "BrickWall.swf"
All three are in the same folder.  What am I doing wrong?

I'm just going to award the points and close the question, but could you keep checking back in until i can solve this problem which has been vexing mw for months.

Thanks,

John
0
 
LVL 11

Expert Comment

by:dodge20
ID: 20459105
if you changed the name of your file - did you change all of the Brick%20Wall.swf to BrickWall.swf?

Did you name your js file foo.js?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

20 Experts available now in Live!

Get 1:1 Help Now