2014-03-18 106 views
1

在IE瀏覽器中使用CSS nowrap出現問題,在Chrome中完美運行。任何人都可以在IE和Chrome瀏覽器中進行渲染而不用任何包裝?CSS白空間:nowrap在IE中不起作用

HTML

<div id="sub_cont"></div> 

CSS

#content{ 
height:14px; 
text-align: left; 
text-decoration: none; 
width: 450px; 
padding-top:25px; 
white-space: nowrap; 
} 

#content #sub_cont{ 
width: 450px; 
display:none; 
height:14px; 
} 

#content .no-rec{ 
color:#000; 
font-family:Arial, Helvetica, sans-serif; 
font-size:14px; 
padding:5px; 
border-bottom:solid #000; 
text-align:left; 
background:#EBEBEB; 
} 

#content .each_rec { 
background: none repeat scroll 0 0 #EBEBEB; 
border-bottom: medium solid #000000; 
color: #000; 
font-family: Arial,Helvetica,sans-serif; 
font-size: 14px; 
padding: 5px; 
height:12px; 
} 

PHP

<?php 
echo "<h2>Search Result</h2>"; 
echo "<table border='0' id='content' cellspacing='2' cellpadding='5'> 
<tr bgcolor='#FFFFCC'> 
<th>VM Name</th> 
<th>vCenter Name</th> 
</tr>"; 

while ($row = sqlsrv_fetch_array($result)) 

{ 
echo "<tr class='each_rec'>"; 
echo "<td>" . $row['VM_NAME'] . "</td>"; 
echo "<td>" . $row['VCENTER_NAME'] . "</td>"; 
echo "</tr>"; 
} 
echo "</table>"; 

if($total==0){ echo '<div class="no-rec">No Record Found !</div>';}?> 
+0

請參閱:http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/whitespace_1.htm –

+0

至極版本的IE?有沒有使用有效的文檔類型? ... –

+0

IE10 <!DOCTYPE html PUBLIC「 - // W3C // DTD XHTML 1.0 Transitional // EN」「http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd」> – solar411

回答