Jump to content

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....
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!
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.
[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.
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.
[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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.