Jump to content


Photo

Table - Works in Firefox but, not in Internet Explorer


  • Please log in to reply
9 replies to this topic

#1 mwmobley

mwmobley
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 October 2006 - 07:26 PM

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....

#2 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 02 October 2006 - 07:29 PM

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?

#3 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 02 October 2006 - 07:30 PM

Can you please give a code example.

me!

#4 mwmobley

mwmobley
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 October 2006 - 07:40 PM

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.testeclif...try_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!

#5 mwmobley

mwmobley
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 October 2006 - 07:46 PM

Or take a look at the difference between Firefox and IE at http://www.testeclif...ountry_kitchen/

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

#6 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 02 October 2006 - 07:52 PM

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.

#7 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 02 October 2006 - 07:53 PM

  //  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>';


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:

<?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>';
?>


The output HTML before the change looks like this:
  <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 -->

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.


#8 nickholt1972

nickholt1972
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts
  • LocationBury, Lancs, UK

Posted 02 October 2006 - 07:55 PM

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 ' and ending it with a ', it won't mind if you have a load of "s in the middle.

nice looking site, by the way.
Nick Holt - Future Guru

#9 mwmobley

mwmobley
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 October 2006 - 08:04 PM

Thanks a Bunch Guys....

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

I REALLY appreciate all the extra eyes!!!

mike

#10 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 02 October 2006 - 10:28 PM

You can't escape things inside of single quotes in PHP.  That is another of the main differences between single and double quotes. 


@Hi I Am Timbo,

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

echo $str;
?>

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users