`

表格中长度太长,显示在一行多余长度不显示或显示为省略号

    博客分类:
  • HTML
阅读更多

使用范例

<HTML> 
<BODY> 
<DIV   STYLE= "text-decoration:underline;color:darkRed; 
font:   bold   20px   Arial;font-weight:bold "> 
Effect   of   CSS   property   <I> text-overflow </I> </DIV> 
<DIV   STYLE= "font:   bold   16px   Arial;   color:darkRed;   font-weight:bold "> 
Each   box   (DIV   element)   below   contains   the   following   text: </DIV> 
<DIV   > We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </DIV> 
<DIV   STYLE= "font:   bold   16px   Arial;color:darkRed;   font-weight:bold "> 
Note   how   the   STYLE   settings   effect   the   rendering   of   the   text </DIV> 
<DIV   STYLE= "position:   relative;   height:   75px;   top:10 "> 
<DIV   STYLE= "position:   absolute;   left:   10px; 
font:   bold   16px   Arial,   sans-serif;   color:   blue;   "> 
STYLE   = "text-overflow   :   clip;   overflow   :   hidden " 
<DIV   STYLE= "position:   absolute;   left:   0px;   top:   18px;   color:   black; 
width:   120px;   height:   50px;   border:   1px   solid   blue; 
font:   14px   Times   New   Roman,   serif;   overflow:   hidden; 
text-overflow:clip "> 
<NOBR> We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </NOBR> 
</DIV> 
</DIV> 
<DIV   STYLE= "position:   relative;   height:   75px;   top:   70 "> 
<DIV   STYLE= "position:   absolute;   left:   10px; 
font:   bold   16px   Arial,   sans-serif;   color:   blue;   "> 
STYLE   = "text-overflow   :   ellipsis;   overflow   :   hidden " 
<DIV   STYLE= "position:   absolute;   left:   0px;   top:   18px;   color:   black; 
width:   120px;   height:   50px;   border:   1px   solid   blue; 
font:   14px   Times   New   Roman,   serif;   overflow:   hidden; 
text-overflow:ellipsis "> 
<NOBR> We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </NOBR> 
</DIV> 
</DIV> 
<DIV   STYLE= "position:   relative;   height:   75px;   top:70 "> 
<DIV   STYLE= "position:   absolute;   left:   10px; 
font:   bold   16px   Arial,   sans-serif;   color:   blue;   "> 
STYLE   = "text-overflow   :   ellipsis;   overflow   :   visible " 
<DIV   STYLE= "position:   absolute;   left:   0px;   top:   18px;   color:   black; 
width:   120px;   height:   50px;   border:   1px   solid   blue; 
font:   14px   Times   New   Roman,   serif;   overflow:   visible; 
text-overflow:ellipsis "> 
<NOBR> We   hold   these   truths   to   be   self-evident, 
that   all   people   are   created   equal. </NOBR> 
</DIV> 
</DIV> 
</BODY> 
</HTML> 

 

分享到:
评论

相关推荐

    GridView控件使用省略号替换超长字符

    在.NET框架中,GridView控件是ASP.NET网页开发中常用的一种数据展示工具,它能够以表格形式呈现数据库或其他数据源中的信息。在处理大量数据时,可能会遇到某个字段的值过长,导致列宽不足以完全显示的情况。为了...

    CSS文本超出指定宽度后隐藏并显示为省略号的实现方法

    设置为 `nowrap` 可以防止文本换行,保证文本在一行内显示,这是实现单行文本溢出显示省略号的必要条件。 2. 实现单行文本溢出显示省略号的方法: - 当需要在单行文本末尾显示省略号时,可以组合使用上述三个属性...

    设置jupyter中DataFrame的显示限制方式

    在 Jupyter Notebook 中,Pandas 库的 DataFrame 对象在默认情况下,为了保持界面整洁,可能会对过长的表格进行截断显示。这包括在行数过多或列数过多时自动换行或省略部分内容。这种行为虽然有其合理性,但有时会...

    Gridview使用.doc

    为了避免表格列过宽,可以限制单元格中显示的文本长度,并用省略号代替多余的部分。这可以通过设置`ItemStyle.Width`属性并使用HTML的`title`属性显示完整文本作为提示。 #### 11. GridView一般换行与强制换行 在...

    vue 判断元素内容是否超过宽度的方式

    1. 首先,确保在你的Vue组件模板中,为需要检测宽度的元素添加一个引用(ref)。例如: ```html 这是需要检测宽度的文本 ``` 2. 在Vue组件的`mounted`或`updated`生命周期钩子中,你可以访问这个引用并进行宽度比较...

    freemarker总结

    defaultValue,第一种用法不给缺失的变量指定默认值,表明默认值是空字符串,长度为0的集合,或者长度为0的Map对象. 使用!指定默认值时,并不要求默认值的类型和变量类型相同.使用??运算符非常简单,它总是返回一个布尔值...

Global site tag (gtag.js) - Google Analytics