繁体   English   中英

表格使用div单元格高度问题(带角度)

[英]table using div cell height issue (with angular)

我桌上的单元格高度有问题。 我尝试将最小高度为115px的工作用于某些数量的语言,但是如果超过该值会破坏单元格。 无论单元中有多少种语言,我都需要扩展该单元。

.comparison-table .lang{
  min-height: 115px;
  height: 100%/auto;
  padding: 15px;
}

在此处输入图片说明

根据上面的要求。

即使我不同意,这是如何为每个对象的第一行添加一个类。 然后让JS找出最高的。 然后将它们全部设置为该高度。

HTML

<div class="test" style="height:40px; width:20px; background-color:red;"></div>
<div class="test" style="height:60px; width:20px; background-color:blue;"></div>
<div class="test" style="height:80px; width:20px; background-color:green;"></div>
<div class="test" style="height:90px; width:20px; background-color:yellow;"></div>

JS

var maxHeight = 0;
$( ".test" ).each(function( index ) {     
    if ( $( this ).height() > maxHeight ){
     maxHeight = $( this ).height();
    }
});

$('.test').css({"height": maxHeight});

代码预览

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM