table td 文字顯示兩行,並且以…結尾,在360兼容模式不兼容解決方案。

table td 文字顯示兩行,並且以…結尾,在360兼容模式不兼容解決方案。
這是一個div裏面包括table。

<div style="margin-left: -16px;width:850px;">
                                    <table class="right-table" id="tableT" border="0" style="margin-bottom:-1px;width:850px;" cellspacing="0" cellpadding="0">
                                        <stw:if test="${empty array }">                            
                                            <tr align="center" >
                                                <td class="text-grey"><span  style="color:#666666;">暫無模板</span></td>
                                            </tr>
                                        </stw:if>
                                        <stw:if test="${not empty array }">
                                            <stw:for items="${array}" var="array1" varStatus="array1Status">
                                            <stw:if test="${array1Status.index<10 }">
                                            <tr>                                           
                                                <td onclick="Model('${array1.templateId}')" class="text-gray ruguo"><p id="${array1.templateId}">${array1.modelContent}</p></td>
                                            </tr>
                                            </stw:if>
                                            </stw:for>
                                        </stw:if>
                                    </table>
  </div>
  .ruguo{
             *display:inline-block;*
             height: 50px;
             width: 850px;
             word-break: break-all;
             display: -webkit-box;
             -webkit-line-clamp: 2;
             -webkit-box-orient: vertical;
             overflow: hidden;
             text-overflow: ellipsis;
             border-bottom:1px #DDD solid;
        }
        .ruguo p{
             margin-top:-9px;
             text-align: left;
             cursor: pointer;
             line-height:22px;
        }

如果沒有帶*標籤代碼,在除360兼容模式,IE,都可以正常顯示,但在360兼容模式和IE不能達到效果。
加上帶*標籤,在ie,360兼容模式也可以達到效果,但是沒有…,如果非要…,可以使用絕對定位把…定到想要的位置。
效果圖:
這裏寫圖片描述
這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章