html - CSS 表格列宽 : fixed - dynamic(30%) - dynamic(70%) - fixed

标签 html css

我设法获得了这种表格布局:

固定-动态(50%)-动态(50%)-固定

http://jsfiddle.net/ihtus/ksucU/

enter image description here

但是我怎样才能得到这种东西呢?固定-动态(30%)-动态(70%)-固定

enter image description here

这是我的 CSS:

table {
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}

td {
    border: 1px solid #333;
}

最佳答案

像这样:

<table>
    <tr>
      <td style="width:200px;">
        200px width - content
      </td>
      <td width="30%">
        dynamic width - content
      </td>
      <td width="70%">
        dynamic width - content
      </td>
      <td style="width:100px;">
         100px width - content
      </td>
    </tr>
  </table>

table {
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}

td {
    border: 1px solid #333;
}

http://jsfiddle.net/7dSpr/

关于html - CSS 表格列宽 : fixed - dynamic(30%) - dynamic(70%) - fixed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12641104/

相关文章:

html - 忽略 iFrame 高度

jquery - 幻灯片(动画)不工作

javascript - 在网站上短时间显示图像的最快和最稳定的方法是什么?

html - 有没有办法让 CSS 解释自定义 alpha 计数器的 `start` 和 `value` 标签的 `ol` 和/或 `li` 属性?

jquery - 从上一个下拉列表中选择后如何自动删除下一个下拉列表?

javascript - 我如何使用条件语句来切换标题的颜色?

html - 有人可以检查我的 html 音频代码有什么问题吗?

html - 为什么我的标题偏到一边?

javascript - 在 Chrome 以外的浏览器中过滤链

html - 使 flexbox 匹配其父级的宽度