<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>table-layout:fixed</title>
<style type="text/css">
.dataTable { width: 100%; border: none; border-collapse: collapse; border-spacing: 0px !important; display: table; table-layout:fixed; }
.dataTable td { word-break: break-all; word-wrap:break-word; }
</style>
</head> <body>
<table class="dataTable" border="1">
<tr>
<td width="120" align="center">阿罗裤剪短发了</td>
<td width="40%">&nbsp;</td>
<td width="120" align="center">&nbsp;</td>
<td width="40%">&nbsp;</td>
</tr>
<tr>
<td align="center">阿罗裤剪短发了</td>
<td>&nbsp;</td>
<td align="center">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;</td>
<td>&nbsp;</td>
<td align="center">阿罗裤剪短发了</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;</td>
<td>&nbsp;</td>
<td align="center">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

table 中,如何使得单元格的内容不换行,单元格不被撑开的更多相关文章

  1. table表格宽度固定,同时td内容过长也不会被撑开

    table表格宽度固定,同时td内容过长也不会被撑开,设置如下css: table{table-layout:fixed;word-break:break-all;}

  2. 获取wpf datagrid当前被编辑单元格的内容

    原文 获取wpf datagrid当前被编辑单元格的内容 确认修改单元个的值, 使用到datagrid的两个事件 开始编辑事件 BeginningEdit="dataGrid_Beginni ...

  3. table中超长字符串省略号表示两种方法

    写在前面:   1.第一种从网上找到的解决方式添加table-layout:fixed   2.第二种添加div   3.字符串过长产生省略号的css语句为如下三种合用:overflow:hidden ...

  4. 如何让table中td宽度固定

    table中td会随着里面的内容伸缩,设置其width样式并没有效果.这个时候需要下面的CSS可以实现. 首先是设置table .table {table-layout:fixed;} 其次是td . ...

  5. css实现table中td单元格鼠标悬浮时显示更多内容

    table中,td单元格无法显示下全部内容,需要在鼠标hover时显示全部内容. 正常显示样式: 鼠标hover时: html: <td>displayAddress<span cl ...

  6. html table中单元格自动换行

    table中单元格自动换行样式: table-layout: fixed; word-wrap: break-word;   table-layout 可能的值(IE不支持inherit属性) 值 描 ...

  7. CSS实现table固定宽度,超过单元格部分内容省略

    <table>单元格的宽度是根据内容的大小自适应的,没有内容的地方就挤到了一起.需要固定表格宽度和每一列的宽度. table-layout:fixed 在固定表格布局中,水平布局仅取决于表 ...

  8. table中tr间距的设定table合并单元格 colspan(跨列)和rowspan(跨行)

    table中的tr的默认display:table-row,虽然可以修改为display:block但是就失去了tr特有的显示效果,如(td自动对齐): 并且在tr中对起设定padding是有用的,可 ...

  9. 读取Excel文件中的单元格的内容和颜色

    怎样读取Excel文件中的单元格的内容和颜色 先创建一个Excel文件,在A1和A2中随意输入内容,设置A1的字体颜色为红色,A2的背景为黄色.需要 using Excel = Microsoft.O ...

随机推荐

  1. eclipse的一些部署

    1. Eclipse导入一个项目Package Exporer-------右键------import------General------Existing Project into Workspa ...

  2. 网页后门工具laudanum

     网页后门工具laudanum laudanum是Kali Linux预先安装的Web Shell工具.它支持多种Web后台技术,如ASP.ASP.net .JSP.PHP.Coldfusion.它提 ...

  3. [BZOJ4237]稻草人(CDQ分治)

    先按y排序,二分,两边递归下去,然后处理下半部分对上半部分的贡献,即左下点在下半部分,右上点在上半部分的合法矩形个数. 两个部分均按x排序,枚举右上点p,则左下点需要满足: 1.横坐标大于上半部分纵坐 ...

  4. poj 1456 贪心+STL

    题意:有n个商品,每个商品如果能在截止日期之前售出就会获得相应利益,求能获得的最大利益 一开始对每个时间进行贪心,后来发现后面的商品可以放到之前来卖,然后就wa了 这里就直接对价格排序,把物品尽量放到 ...

  5. 25.最小生成树(kruskal算法)

    时间限制: 1 s 空间限制: 128000 KB 题目等级 : 白银 Silver 题解 查看运行结果 题目描述 Description 农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立 ...

  6. asp.net调用存储过程1

    1,传入参数,传出参数 public int GetTeam1Id(string userId)        {            int team1ID = -1;            st ...

  7. Codeforces Round #245 (Div. 2) B. Balls Game 并查集

    B. Balls Game Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/430/problem ...

  8. C# WebHelper-CookieHelper,CacheHelper,SessionHelper

    常用web操作工具类,记录一下,本文记录的工具类,都要求引用 System.Web 1.CookieHelper /// <summary> /// Cookie工具类 /// </ ...

  9. directio mysql 编绎选项

    http://www.myexception.cn/linux-unix/495407.html http://www.iyunv.com/thread-25950-1-1.html

  10. JavaScript中typeof详解

    [范围]typeof返回值范围: typeof返回值对应 类型 结果 String "string" Number "number" Boolean " ...