惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - 齐世昌

.resources文件转.resx 文件 同一Session中的aspx页面的并发限制 Diving Into Lync Client Logins Passing JavaScript Objects to Managed Code UI抑制限制(UI Suppression Limitations) JSON对象末尾多余逗号问题 T430 Windows 8 的USB3.0无法识别 【翻译】数据库上的IO已冻结,不需要任何用户操作 【翻译】为Web Forms添加捆绑(Bundling)和压缩(Minification) 禁用笔记本WiFi热点网络连接问题 推荐一个在线压缩JavaScript和CSS的网站 Windows 8不支持Windows XP 模式 又是一年(2012年) 本地测试网址推荐 Windows Server 2012 不支持SharePoint Server 2010(KB2724471) VirtualPathUtility.IsAppRelative的bug? 神奇的img 受信任站点在Windows 7 和Windows XP的注册表中的不同 contenteditable属性浏览器支持情况(基本支持)-工作草稿
text-overflow: ellipsis 在IE8、9下显示问题
齐世昌 · 2012-10-31 · via 博客园 - 齐世昌

通过样式可以使在table中如果td中的内容过长时,过长的部分显示为省略号。

如下图所示:

image

样式也很简单,代码如下:

<!DOCTYPE html>


<html>
<head>
    <title>New Document </title>
    <style>
        .ctl {
            table-layout: fixed;
        }

            .ctl td {
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
                padding: 2px;
            }
    </style>

</head>

<body>
    <table cellspacing="0" cellpadding="1" width="100%" class="ctl" border="1">
        <colgroup>
            <col>
            <col width="100">
        </colgroup>
        <tbody>
            <tr>
                <td>内容还不算很长很长</td>
                <td>内容比较短</td>
            </tr>
            <tr>
                <td>内容很长很长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长</td>
                <td>内容比较短</td>
            </tr>
            <tr>
                <td>内容很长很长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长</td>
                <td>内容比较短</td>
            </tr>
            <tr>
                <td>内容很长很长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长</td>
                <td>内容比较短</td>
            </tr>
        </tbody>
    </table>
</body>
</html>

现在的实现在IE8或者9下,如果以内容字母开头,显示效果就会出现不一致的情况。效果如下:

image

看来IE自动识别的字体。

如果为设置字体后呢,先设置为font-family:宋体;效果如下:

image

设置为font-family:Arial;效果如下:

image

如果要想保证效果统一,必须要设置字体,而且必须要设置为中文字体了。