简体   繁体   中英

table using div cell height issue (with angular)

I'm having an issue with cell height on my table. I tried putting min-height of 115px sort of work for certain number of languages but if its more than it breaks the cell. I need the cell to expand no matter how many languages there are in the cell.

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

在此处输入图片说明

Based on what was asked above.

Even though I do not agree with this, here is the how to add a class to the the top row for each object. Then have JS to find what one has the max hight. Then set them all to that height.

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});

Code Preview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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