我们经常会使用table,并且去手动的设置它的宽度,比如:

<table>
   <tr>
        <td class="left">...</td>
        <td class="right">...</td>
   </tr>
</table>

样式:

.left{width:20%;}
.right{width:80%;}

但是发现,只要有一个td超过了原本设置宽度,所以td的宽度都不会根据我们设置的宽度显示。

这时,就需要我们去设置 table-layout 属性为 fixed

table-layout:fixed;

table-layout 属性就是用来规定表格单元格、行、列的算法规则。

该值只有三个值:auto(自动),fixed(固定), inherit(继承父级标签的table-layout值)。

所以在我们要设定table中的tr、td高宽的时候,最好先设定table中的table-layout为fixed。

关于 table-layout 属性的更多相关文章

  1. Android表格布局(Table Layout)

    Android表格布局(Table Layout) 先来看布局管理器之间继承关系图: 图1 可知TableLayout继承了LinearLayout,所以表格布局本质上依然是线性管理器. 表格布局采用 ...

  2. Xamarin Layout属性(转)

    第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中 android:layout_centerVertical 垂直居中 android: ...

  3. Android:layout属性大全

    Android layout属性大全 第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中android:layout_centerVert ...

  4. HTML+css基础 表格标签table Table标签属性 td标签属性

    表格标签table:   他是由行与列构成,最小单位是单元格. 行标签  <tr></tr> 单元格标签<td></td> Table标签属性: Bor ...

  5. IE的layout属性详解

    http://www.cnblogs.com/yuzhongwusan/archive/2012/03/09/2387052.html 很多在谷歌浏览器(chrome).火狐浏览器(Fire Fox) ...

  6. ExtJS 布局-Table布局(Table layout)

    更新记录: 2022年6月1日 开始. 2022年6月10日 发布. 1.说明 table布局类似表格,通过指定行列数实现布局. 2.设置布局方法 在父容器中指定 layout: 'table' la ...

  7. mybatis-generator XML Parser Error on line 38: 必须为元素类型 "table" 声明属性 "enableInsertByPrimaryKey"。

    1. 解决方法 在 table 元素中删除属性 enableInsertByPrimaryKey 即可.就是这么神奇... 2. 情景重现 使用 mybatis-generator 插件生成代码时报错 ...

  8. bootstrap table表格属性、列属性、事件、方法

    留存一份,原文地址http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/ 表格参数 表格的参数定义在 jQuery.fn.bootst ...

  9. html table 的属性

    表格table th,td 文字顶部对齐 <th valign="top"></th> <td valign="top">& ...

  10. layout属性

    RelativeLayout 第一类:属性值为true可false android:layout_centerHrizontal        水平居中 android:layout_centerVe ...

随机推荐

  1. 【转载】Xcode6中添加pch文件

    //原文地址:http://www.cnblogs.com/YouXianMing/p/3989155.html 1. 新建工程: 2. 创建pch文件:cmd+n->other->PCH ...

  2. 伪元素”:after” , “:before"

    伪元素就是源码html中不存在,而视觉上又存在的元素     简单用法: blockquote:before {      content: open-quote;      // 其他样式 } // ...

  3. Word Amalgamation(hdoj1113)

    Word Amalgamation Problem Description In millions of newspapers across the United States there is a ...

  4. 正式学习React(一) 开始学习之前必读

    为什么要加这个必读!因为webpack本身是基于node环境的, 里面会涉及很多路径问题,我们可能对paths怎么写!webpack又是怎么找到这些paths的很迷惑. 本文是我已经写完正式学习Rea ...

  5. tomcat优化-有改protocol 和 缓存 集群方案

    tomcat优化 在线上环境中我们是采用了tomcat作为Web服务器,它的处理性能直接关系到用户体验,在平时的工作和学习中,归纳出以下七种调优经验. 1. 服务器资源 服务器所能提供CPU.内存.硬 ...

  6. leetcode Permutation

    Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the follow ...

  7. http 中get和post

    1. http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html 浅谈HTTP中Get与Post的区别 2009-03-31 14:51 ...

  8. ps 导出png-8图片会变模糊

    出现这种情况的时候,在保存png-8图片的时候,索引色需要改为256,否则保存的图片颜色与原图会不一致.

  9. ReactNative常见报错

    1.导出模块错误 遇到这样的错误,首先检查代码有闭合一致,如果没有错误的话,则去检查是否是导出模块的错误. 如: export default moduleName; 改为: module.expor ...

  10. linux系统关机与重新启动命令

    在linux下关机和重新启动系统有shutdown.halt.reboot.init,对于他们来说他们的内部工作过程是不同样的. 1.shutdown命令 使用它能够安全地关闭系统.然而在关闭系统时. ...