html - 像表格一样使用 div

标签 html css

如何在不使用表格而只使用div的情况下进行布局?

最佳答案

您可以使用一个div 和相应的css 来生成表格布局。 例如

<div class="table">
    <div class="row">
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
    </div>
</div>

在css中,它会是这样的

.table { display: table; }
.row { display: table-row; }
.cell { display: table-cell; }

关于html - 像表格一样使用 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32657711/

相关文章:

javascript - 获取嵌入式pdf的当前页码

javascript - jquery 动画方法的参数

html - IE8/9 window.postMessage 不工作,但为什么?

html - 为什么将我的 div 变成一个圆圈会影响 bootstrap 列?

html - 如何在容器内获取列表项的前导点

javascript - 无法获得下拉 3 栏菜单以具有背景或关闭

html - 在显示 :Fixed 中拉伸(stretch) HTML5 中的 iframe

html - 溢出 :hidden on div tag affects background color

html - CSS Font Awesome 图标在 IE 10 中可点击

css - Angular 单选按钮 :checked