javascript - HTML - Make table minimum height matches the current screen height -


i designing web page using table, layout looks following:

<html>    <head>      </head>    <body>      <table>        <tr><td></td></tr>        <tr><td></td></tr>        <tr><td></td></tr>        </table>      </body>    </html>

i need table minimum height match screen height, when content height less screen height should match screen height adding space in middle row.

what simplest way achieve this?

do not use <table> elements layout. in fact, css3 flexbox specification created layout requirements yours—the trick use display flex on parent element, , ensure row want fill minimum height allowed grow, using flex-grow: 1. parent should have minimum height of 100vh.

body {    padding: 0;    margin: 0;  }  div.content-wrapper {    display: flex;    flex-direction: column;    min-height: 100vh;  }  div.row-2 {    background-color: #333;    color: #eee;    flex-grow: 1;  }
<div class="content-wrapper">    <div class="row-1">row 1</div>    <div class="row-2">row 2</div>    <div class="row-3">row 3</div>  </div>


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -