css处理过长文字自动隐藏(兼容IE和firefox)

来源:互联网 发布:中箭组mod整合捏脸数据 编辑:程序博客网 时间:2024/05/21 17:03

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 <xsl:template match="channel">
  <xsl:variable   name="basePath"   select="basePath"/>
  <xsl:variable   name="listSize" select="params/listSize"/>
  <xsl:variable   name="import_user_item" select="messages/import_user_item"/>
  <div class="widget-content">
   <table width="90%" border="0" cellpadding="1" cellspacing="2" style="table-layout:fixed;">
    <tr>
     <td width="76%"></td>
     <td width="24%"></td>
    </tr>
    <xsl:for-each select="item">
     <xsl:sort select="subject" />   <!--根据标题排序 -->
      <tr>
       <td align="left" style="overflow: hidden; white-space: nowrap; padding: 0pt 0pt 0pt 0px;">
        <img>
          <xsl:attribute name="src"><xsl:value-of select="$basePath" />/images/desk/img/lit_tub.jpg</xsl:attribute>
        </img>
        <xsl:value-of select="subject" />
       </td>
       <td align="right">
         <xsl:value-of select="substring-before(createAt,' ') "/>
       </td>
      </tr>
    </xsl:for-each>
   </table>
   <xsl:if test="$listSize &gt; 0">
    <h3 align="right">
     <a target="_blank">
      <xsl:attribute name="href">
                                         <xsl:value-of select="$basePath" />/news.do?method=toLoadList
                     </xsl:attribute>
      <xsl:value-of select="messages/more" />
     </a>
    </h3>
   </xsl:if>
   <xsl:if test="$listSize = 0">
    0<xsl:value-of select="$import_user_item" />
   </xsl:if>
  </div>
 </xsl:template>
</xsl:stylesheet>

 

 

文中用红色注明的为解决方案
另外得控制住每列的宽度,用具体像素或者百分比都OK
弄了好久,终于解决了。。。

 

原创粉丝点击