Jump to content

IE is acting up (FF is perfect)


Hooch

Recommended Posts

**RESOLVED**Hello. Could someone please let me know why this code is notworking in IE? It does not put the images at the top of the "<td>" field. It drops the pics down about 2 rows then displays them.

<table width="700" height="" border="1" align="center" cellpadding="0" cellspacing="0">  <tr>	<td height="30" colspan="2" align="center" class="black-medium"> </td>  </tr>  <tr>	<td width="116" height="" align="left" valign="top"><?php include 'includes/links.php';?></td>	<td width="584" height="" align="center" valign="top">  ***PROBLEM STARTS HERE***		  <?PHP		  echo "<table width=\"\" border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#999999\" bordercolor=\"#B51628\">";		  while ($row = mysql_fetch_assoc($result))		  {		  if ($nr % $nr_per_row == 0)		  echo "<tr>";  //output <tr> if this is the first in a row		  echo "<td>";		  echo "<a href=\"".$row['link']."\"><img name=\"\" src=\"images/sponsors/".$row['id'].".jpg\" width=\"200\" height=\"75\" alt=\"\" border=\"0\"/></a>";		  echo "</td> ";		  $nr++;		  if ($nr % $nr_per_row == 0)		  echo "</tr>";  //output </tr> if this is the last in a row		  }		  if ($nr % $nr_per_row != 0)		  echo "</tr>"; //clean up		  echo "</table>";		  		  ?>	</td>  </tr></table>

Of course Firefox is working correctly. IE2.jpg FF1.jpgThank you for any help.

Link to comment
Share on other sites

Hi!I don't think it's a problem with the PHP, instead (as usual) it's IE that miss things up...try adding this into your head-tag (or the CSS-file, then remove the style-tags)

<style type="text/css"> td { vertical-align: top }</style>

It should make the content to be at the the top in all the cells (including the ones in the "inner" table).When it comes to PHP you can remove the double quotes, and emove whith singlequotes instead (looks better):

// Orig:echo "<table width=\"\" border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#999999\" bordercolor=\"#B51628\">";// Better:echo '<table border="1" cellpadding="1" cellspacing="0" bgcolor="#999999" bordercolor="#B51628">';

I also remove the with argument as there's no reason to use it when empty (Not sure on that it's eaven supported anymore [XHTML])Then I would recommend using CSS for all formating/layout colors etc. It's much easier and you get much cleaner code.EDIT:Missed the images (guess you added them later). Looks like you have problems with the height also... Remove any empty arguments (including height="") and try it in IE, if that doesn't work use CSS (for example try the "holy hack") to give the table a minimum height:

table {	  height: 1%; }

or soomething like that (not realluy holy hack, but still...Good Luck and Don't Panic!

Link to comment
Share on other sites

Okay, I'll give it a try. I do use a style.css page. But problem is I have td's that need info in the middle. So I guess I will have to make this

<style type="text/css">td { vertical-align: top }</style>

more specific?

Link to comment
Share on other sites

When I have that problem I use that rule than this class for cells that need the content in the middle:

.vac { vertical-align: middle }

(vac as in vertical align center)

Link to comment
Share on other sites

gotchaWhat if I do this..

/*  ==========  table stuff ==========  */.vac { vertical-align: middle }.vat { vertical-align: top }

Then just link to the one I want. (I know why you said your way...to save code by having a default)Now in my posted code (in the 1st post) where do I link the ".vat" too?

Link to comment
Share on other sites

First:Well it works, but the reason to why I recommend having a default is that you are much more like to have it on the top (as a "rule") and having it in the middle on much lesser cells (as an "exception"). By using a default you never have to worrie about setting vat on every cell, instead it's there by default.Yes, it saves code, but the main reason to it is to save some writing (I know; same thing) and headakes, mainly when you forgot to add vat to some cells (then you need to go over your code again to find the cells).If you still want to use to seperate class (and no default) you should set class="vat" to all cells in your table...

Link to comment
Share on other sites

I recoded that 1 post. It now enters the pictures at the top of the table, like firefox. But now it shuffles them over to the left. I coded it to go center. Here is the code

<table width="700" height="" border="1" align="center" cellpadding="0" cellspacing="0">  <tr>	<td height="30" colspan="2" align="center" class="black-medium"> </td>  </tr>  <tr>	<td width="116" height="" align="left" valign="top"><?php include 'includes/links.php';?></td>	<td width="584" height="" align="center" class="vat">	<?PHP	$nr_per_row = 2;	$nr = 0;	$result = mysql_query("SELECT * FROM sponsors WHERE active = 1") or die(mysql_error());	echo '<table width="584" border="1" cellpadding="1" cellspacing="0" bordercolor="#B51628">';		while ($row = mysql_fetch_assoc($result))	{	if ($nr % $nr_per_row == 0)	  echo "<tr valign=\"center\" align=\"center\">";  //output <tr> if this is the first in a row	  echo "<a href=\"".$row['link']."\"><img name=\"\" src=\"images/sponsors/".$row['id'].".jpg\" width=\"200\" height=\"75\" alt=\"\" border=\"0\"/></a>  ";	  $nr++;	  if ($nr % $nr_per_row == 0)	echo "</tr>";  //output </tr> if this is the last in a row}	if ($nr % $nr_per_row != 0)	  echo "</tr>"; //clean up	echo "</table>";	  	?>	</td>  </tr></table>

Here is the view source

<table width="700" height="" border="1" align="center" cellpadding="0" cellspacing="0">  <tr>	<td height="30" colspan="2" align="center" class="black-medium"> </td>  </tr>  <tr>	<td width="116" height="" align="left" valign="top"><table width="116" height="" border="0" cellpadding="0" cellspacing="0">  <tr>	<td height="230">	<a href="http://www.com/tia/index.php" class="tia">home</a><br />	<br />	<a href="http://www.com/tia/members/index.php" class="tia">members</a><br /><br />	<a href="http://www.com/tia/tours.php" class="tia">tours</a><br /><br />	<a href='events/March.php' class="tia">events/links</a><br><br>	<a href="http://www.com/about.php" class="tia">about us</a><br /><br />	<a href="http://www.com/contact.php" class="tia">contact</a><br /><br />	<a href="http://www.com/sponsor.php" class="tia">sponsors</a><br />	<br /></td>  </tr></table></td>	<td width="584" height="" align="center" class="vat">	<table width="584" align="center" border="1" cellpadding="1" cellspacing="0" bordercolor="#B51628"><tr valign="center" align="center"><a href="http://#"><img name="" src="images/sponsors/1.jpg" width="200" height="75" alt="" border="0"/></a>  <a href="http://#"><img name="" src="images/sponsors/2.jpg" width="200" height="75" alt="" border="0"/></a>  </tr><tr valign="center" align="center"><a href="http://#"><img name="" src="images/sponsors/3.jpg" width="200" height="75" alt="" border="0"/></a>  <a href="http://#"><img name="" src="images/sponsors/4.jpg" width="200" height="75" alt="" border="0"/></a>  </tr><tr valign="center" align="center"><a href="http://#"><img name="" src="images/sponsors/5.jpg" width="200" height="75" alt="" border="0"/></a>  <a href="http://#"><img name="" src="images/sponsors/6.jpg" width="200" height="75" alt="" border="0"/></a>  </tr><tr valign="center" align="center"><a href="http://#"><img name="" src="images/sponsors/7.jpg" width="200" height="75" alt="" border="0"/></a>  </tr></table>	</td>  </tr></table>

Link to comment
Share on other sites

okay...here's a good one. I got this page working perfectly. So I had my clientcheck out the test page. He doesn't see the pictures. So I fired up my 2nd pc and had a try. Same problem. But I see the pics from IE and FF fine on the PC I coded with. I put a border around the pictures and that even shows up. But still no pictures. I then directly link to a picture frommy second machine and it sends me to a numerical address. h**p://numbers_go_here:1025/clear.cgi? Any ideas??Here is the actual page LINKYThere are 8 pictures in this query.

Link to comment
Share on other sites

First:I have no problem viewing the images (wokrs both on the site and direct).Second:From your description it sounds like youre having problems with your server and it's configurations (which do you use?).What the problem is is hrad to tell (as it worked for me), but check the configuration so you don't deny/ban any range of IPs

Link to comment
Share on other sites

That's a good question.I can't see another reason to why it does like that (unless you have a problem with the "personal firewall" and/or the browser).It could block a IP from the network but not loclahost for example, but this would perhaps not be the case if you see the page, but not the images...

Link to comment
Share on other sites

I called tech support they say it's client side. So I uploaded Firefox on the second computer and it's still a no go. Time to get the 3rd puter involved. Maybe even the lap top..Update...3rd computer shows the page on both browsers.Update #2I am at work today and all is well here.It has to be my local machine.FYI...I tried changing the code so there was no DB inquiry. I linked to the pictures via straight html. And it still did notwork.Also, notice the links on the left. I added a cpl and my customer (who also cannot see the pictures) cannot seeone of the links I added. He sees the space there though.wierd and whacky stuff.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...