简体   繁体   English

CSS空格:nowrap在IE中不起作用

[英]CSS white-space: nowrap not working in IE

Having a problem in IE with CSS nowrap in IE, works perfectly in Chrome. 在IE中遇到问题,而IE中的CSS nowrap可以在Chrome中完美运行。 Can anyone help out so it renders without any wrapping in IE and Chrome? 任何人都可以帮忙,使其呈现而无需在IE和Chrome中进行任何包装吗?

HTML HTML

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

CSS 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

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

In internet explorer we must use the whiteSpace property in order to nowrap text, the documentation for the usage of whiteSpace is linked below. 在Internet Explorer中,我们必须使用whiteSpace属性才能立即显示文本,有关使用whiteSpace的文档在下面链接。 Good luck, and remember to use the most recent version of IE in order to maintain accuracy. 祝您好运,并请记住使用最新版本的IE,以保持准确性。

Link: http://msdn.microsoft.com/en-us/library/ie/ms531182(v=vs.85).aspx 链接: http//msdn.microsoft.com/zh-cn/library/ie/ms531182(v = vs.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM