Html CSS-<;部门>;高度

Html CSS-<;部门>;高度,html,css,Html,Css,编辑: 我有以下HTML代码: <div class="div-table"> <div class="div-table-row"> <div class="div-table-first-col"> <div>11:00</div> </div> <div class="div-table-col"> &l

编辑:

我有以下HTML代码:

<div class="div-table">
    <div class="div-table-row">
        <div class="div-table-first-col">
            <div>11:00</div>
        </div>
        <div class="div-table-col">
            <div style="height: 11"></div>
            <div class="appuntamentoContainer">
                <div class="appuntamento" style="height: 25px">11:12 - 12:35</div> //--> need to stretch to bottom
            </div>
        </div>
        <div class="div-table-col">
            <div style="height: 0"></div>
            <div class="appuntamento">11:00 - 11:45</div>
            <div class="appuntamento">11:00 - 12:00</div>
            <div class="appuntamento">11:45 - 12:30</div>
        </div>
        <div class="div-table-col">
            <div style="height: "></div>
        </div>
        <div class="div-table-col">
            <div style="height: "></div>
        </div>
    </div>
</div>


请注意垂直边框。左边是它的实际情况,右边是它应该如何。如何将div拉伸到底部?

添加高度:在父表和td上为100%

table {
  height: 100%;
}
td {
  height: 100%;
}

查看此处以供参考:

查看以下动态行为:

jQuery

var a=$(".second").outerHeight();

$(".first").height(a);
$(".third").height(a);
使用布局模型。只需添加
display:flex
.div表行
,并删除任何
浮动
显示
属性


以下是。

你应该在……拿一个战利品。你能分享一下你到底想要什么吗?
应该实现什么。。这就是你想要的吗?再看一次…现在应该行了…不是真的。我不想把它扩大到100%,但到了td的底部。对不起,没有理解你。什么消失了?老兄,这有什么问题吗。我是说你想让它充分伸展。所以我给了它第二个
div表col
中的高度。至少这是你的图片所暗示的我没有要求用jQuery来做…我想用css来做。如果我有15行6列呢?我应该使用jQuery设置所有这些吗?这段代码也适用于该场景。您可以为没有最大高度的
div table col
div赋予相同的类,然后可以将这些div的高度设置为最大
div table col
的高度。全屏观看这把小提琴。
var a=$(".second").outerHeight();

$(".first").height(a);
$(".third").height(a);