表格单元格 - 某种 colspan? [英] table-cell - some kind of colspan?

查看:20
本文介绍了表格单元格 - 某种 colspan?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有点困惑,因为我有有效的 CSS 代码,但它一点也不漂亮.我现在想重新设计这个 CSS 样式并通过 LESS 构建它们.我对 display:table;/display:table-row;display:table-cell; 有很大的问题.

I am a bit puzzled right now, because I had CSS code that worked, but it wasn't beautiful at all. I now want to rework this CSS styles and build them via LESS. And I have big problems with display:table; / display:table-row; and display:table-cell;.

例如我有以下代码:http://jsfiddle.net/La3kd/2/

我怎样才能做到最后一个单元格(中心)不会将上面的第二个单元格向右移动?最后一个单元格的宽度应与上面 2 个单元格的宽度相同.需要某种 colspan.这太奇怪了,因为在我重新编写代码之前,我的印象是它可以工作.但是现在右边的所有元素都完全移动了.

How can I do it that the last cell (center) does not shift the above second cell to the right? The last cell should have the width of the 2 cells above. Some kind of colspan is needed. It is so weird, because I have the impression that it worked before I reworked the code. But now all elements to the right are totally shifted.

推荐答案

CSS 没有 colspan 模拟.根据您的示例,您可以将最后一行标记为单独的不可显示块.

CSS has no colspan analog. Based on your example, you can just mark up your last row as a separate nontably block.

您还可以将 display: table-captioncaption-side: bottom 结合使用,将表格行显示为跨越所有列的最后行".请参阅现场演示.

You could also use display: table-caption in conjunction with caption-side: bottom to display the table row as a last "row" that spans all columns. See live demo.

这篇关于表格单元格 - 某种 colspan?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆