Forum Moderators: coopster
I have an image problem in IE only when I call up a series of images over PHP to sit in a table cell. The images dont wrap once they hit the table wall of say 80% - thet just carry on on one line and force the browser to horizontal sccroll which is bad. Note in every other browser the images wrap when needed to.
Here is the php code and html.
<?
include('connection.php');
include('variables.php');
$sql = "SELECT DISTINCT manufacturer FROM tbl_manufacturer WHERE status=1 AND id NOT BETWEEN 57 and 63 ORDER BY RAND() LIMIT 12";
$sql_result = mysql_query($sql);
$sql_count = mysql_num_rows($sql_result);
//may need to limit to fewer in smaller browser
//echo $sql_count;
?>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="center">
<? while ($result = mysql_fetch_array($sql_result)) { $manid = str_replace(" ", "%20", $result[0]);?>
<a href="<?=$root;?>/pages/category.php?man_id=<?=$manid;?>"><img src="<?=$root;?>/pages/images/<?=$manid;?>.jpg" alt="<?=$result[0];?>" title="<?=$result[0];?>" hspace="1" vspace="1" border="0"></a> <?
echo "\n ";
$yz++;
if ($yz % 3 == 0) { echo "<br>"; }
}
?>
</td>
</tr>
</table>
Note that this piece of the code
if ($yz % 3 == 0) { echo "<br>"; }
forces a new line after 3 logos are called up which is not ideal as it looks a little stupid.
Here is the page where you will find this code at work - unles my partner has changed it - either way you will see the logos near the top of the page - these are the issue.
Any ideas how to get them to react in ie the same as they do elsewhere?
ta
Alex
What you need to do is take the HTML that PHP generates, save it to an HTML file, mess with it in an editor or even a WYSIWYG HTML editor until it looks right in all browsers, and *then* figure out what PHP code you need to use to generate that HTML.
As a first step, run your page through the W3C validator.