make div height automatically adjust to viewport using css -


i want show data in table should scroll when data in tbody exceeding viewport height.

here jsfiddle: http://jsfiddle.net/91zxh69r/

i able make scroll using

{     max-height: 200px;     overflow: auto; } 

but problem here height getting fixed because of max-height: 200px.

how can make tbody height adjustable according viewport using css ? can please ?

thanks

you wrap table div , stretch wrapping div on height:

html

<div class="tablewrapper">     <table>         ...     </table> </div> 

css:

.tablewrapper { height: 100%; overflow: auto; } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -