Jump to content

Archived

This topic is now archived and is closed to further replies.

mwmobley

Table - Works in Firefox but, not in Internet Explorer

Recommended Posts

I have a simple 2 col 5 row table that i'm using to display a description in the first row and a thumbnail link in the second.

I originally created the HTML for the table in DreamWeaver, then used the HTML to create my echos in php since I need to retrieve the descriptions from mysql. 
It works perfectly in Firefox and Netscape but, Internet explorer draws a border around it (with border=0) and only displays 1 of the five thumbnails.

Also, the HTML works just fine in Internet Explorer. 

Why would IE treat the php code differently?

Any help would REALLY be appreciated.  I don't understand why it works perfectly in one place and is so screwed up in the other....

Share this post


Link to post
Share on other sites
IE Doesn't treate php code at all.  It only interprets the HTML that it sees.  There is likely an error in the HTML that is being output.  Can you supply some code?

Share this post


Link to post
Share on other sites
Heres the php code that starts the table and the first row.

  //  Create table to display teasers and link on mag home page
  echo '<table width=\"347\" height=\"464\" border=\"0\"  cellpadding=\"0\" cellspacing=\"0\">';
  // Camping Row
  echo '<tr>';
  echo '<td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />';
  echo "$CampingTeaser</p></td>";
  echo '<td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td>';
  echo '</tr>';


Here is a link to where I have been working on it http://www.testeclifestyle.com/guest/country_recreation/

The top part is straight HTML, the bottom is this first line in PHP.  In Firefox, you will see it centered in the table..in IE it comes up w/borders an no thumbnail....thanks for looking!

Share this post


Link to post
Share on other sites
Or take a look at the difference between Firefox and IE at http://www.testeclifestyle.com/guest/country_kitchen/

I don't understand whats causing this in IE.....thanks for the help

Share this post


Link to post
Share on other sites
well, the first thing that jumps out at me is you're escaping double quotes inside the single quotes -- this is not necessary. I checked your link source in my browser and see that they remain escaped (which could throw IE for a loop). Fix that and see what happens.

Share this post


Link to post
Share on other sites
[quote author=mwmobley link=topic=110282.msg445546#msg445546 date=1159818051]
  //  Create table to display teasers and link on mag home page
  echo '<table width=\"347\" height=\"464\" border=\"0\"  cellpadding=\"0\" cellspacing=\"0\">';
  // Camping Row
  echo '<tr>';
  echo '<td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />';
  echo "$CampingTeaser</p></td>";
  echo '<td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td>';
  echo '</tr>';
[/quote]

You can't escape things inside of single quotes in PHP.  That is another of the main differences between single and double quotes.  Looks like you have the variable parsing down.  I would recommend just changing the first and last quotes to double quotes:

[code]
<?php
  //  Create table to display teasers and link on mag home page
  echo "<table width=\"347\" height=\"464\" border=\"0\"  cellpadding=\"0\" cellspacing=\"0\">";
  // Camping Row
  echo '<tr>';
  echo "<td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />";
  echo "$CampingTeaser</p></td>";
  echo "<td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td>";
  echo '</tr>';
?>
[/code]


The output HTML before the change looks like this:
[code]
  <table width=\"347\" height=\"464\" border=\"0\"  cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />If you are crazy enough....</p></td><td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td></tr></table>  <!-- End mwm -->
[/code]

Another fix would be using single quotes and not escaping the double quotes.  The only problem is then you can't insert newlines in your HTML, which you should.

Share this post


Link to post
Share on other sites
I'm not really an 'advice-giving level' expert but I do a lot of things for ie and I don't think you need all those backslashes because if you're starting your echo string with a [b]' [/b]and ending it with a [b]'[/b], it won't mind if you have a load of [b]"[/b]s in the middle.

nice looking site, by the way.

Share this post


Link to post
Share on other sites
Thanks a Bunch Guys....

It really threw me when it worked correctly in Fiefox and Netscape.....

I REALLY appreciate all the extra eyes!!!

mike

Share this post


Link to post
Share on other sites
[quote author=Hi I Am Timbo link=topic=110282.msg445555#msg445555 date=1159818822]
You can't escape things inside of single quotes in PHP.  That is another of the main differences between single and double quotes.  [/quote]

@Hi I Am Timbo,

[code]
<?php
$str = 'It\'s possible to escape single quotes at least';

echo $str;
?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.