2013-02-23 14 views
1

我對圖像庫的表格不滿意,但在IE瀏覽器中表現不好,但在Mozilla Firefox中顯示正常。IE中的HTML數據結構

問題是,圖片庫滾動一路水平超出邊界,而不是分裂到下一行。

下面是代碼:

<?php 

include("includes/config_gallery.php"); 

    $sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY cobjecttype ORDER BY cobjecttype"; 
    $sql_result = mysql_query ($sql, $connection) or die ('request "Could not execute SQL query" '.$sql); 
    while ($row = mysql_fetch_assoc($sql_result)) { 
     echo "<option value='".$row["cobjecttype"]."'".($row["cobjecttype"]==$_REQUEST["cobjecttype"] ? " selected" : "").">".$row["cobjecttype"]."</option>"; 
    } 


$count = 0; 

if ($_REQUEST["string"]<>'') { 
    $search_string = " AND (ctitle LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%' OR csubject LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%')"; 
} 

if ($_REQUEST["ref"]<>'') { 
    $search_string = " AND (creference LIKE '%".mysql_real_escape_string($_REQUEST["ref"])."%')"; 
} 

if ($_REQUEST["cobjecttype"]<>'') { 
    $search_cobjecttype = " AND cobjecttype='".mysql_real_escape_string($_REQUEST["cobjecttype"])."'"; 
} 
if ($_REQUEST["cartist"]<>'') { 
    $search_string = " AND (cartist LIKE '%".mysql_real_escape_string($_REQUEST["cartist"])."%')"; 
} 

if ($_REQUEST["cyear"]<>'') { 
    $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE cyear = '".mysql_real_escape_string($_REQUEST["cyear"])."'".$search_string.$search_cobjecttype; 
} 
else { 
    $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE c_id>0".$search_string.$search_cobjecttype; 
} 

$sql_result = mysql_query ($sql, $connection) or die ('request "Could not execute SQL query" '.$sql); 
if (mysql_num_rows($sql_result)>0) { 
    while ($row = mysql_fetch_assoc($sql_result)) { 
    $c_id=$row['c_id']; 
?> 
    <td valign=top> 

    <table width=150 border=0 align=left class=allborder> 
    <tr> 
    <td width=70 bgcolor=#eee><a href="details.php?c_id=<?php echo $c_id; ?>" > <?php echo $row['ctitle']; ?> </a></td> 
    </tr> 
    <tr> 
     <td><a href=details.php?c_id=<?php echo $c_id ?> ><img src="./images/<?php echo $row['cfilename']; ?>" width="90" height="120" alt="" /></a> 
     </td> 
    </tr> 

    </table> 

<?php $count++; 
    if ($count %8 == 0 && $count < $num) { 
?> 
<tr> 
<?php } ?> 
</tr> 
</td> 


<?php 
    } 
} else { 
?> 
<font color=red>No results found.</font> 
<?php 
} 
?> 

請幫助。

約瑟夫

回答

0

我會建議使用IE特定的CSS,將給予最大寬度的照片庫是在該地區。

IE6 css specific 

* html ‪#‎div‬ { 
height: 300px; 
} 

IE7 css specific 

*+html #div { 
height: 300px; 
} 

IE7&8 css specific (also seems to work in 10, haven't tested it in 9 

#div { 
height: 300px\9; 
}