The height
is related to container in which the element is contained.
whereas the container of your table is the body
document, it is necessary that the document also has 100% height. For this, a way to define the height height=100%
of the document (body, html) is apply in CSS:
<style>
html, body{ height: 100%; }
</style>
In this way, your table with height:100%
will be the same height as the document (browser visible area).
You can also use the 100vh
in the element (height:100vh
), but some older browsers do not support this value vh
(ex. Safari for Windows, Safari and Chrome on older iPhones).
Another solution with jQuery, without the CSS mentioned above:
<table id="id_tabela" style="width: 100%;" align='center' border='1' cellpadding='0' cellspacing='0'>
<script>
$(window).on('load resize',function(){
$("#id_tabela").css("height",window.innerWidth+"px");
});
</script>
post your entire code, heigth: 100%, depends on the containers to work.
– Felipe Duarte
You can use it
height: 100vh;
– Rafael Augusto
The code is too long to put here... just go to the page and give Ctrl + U.
– user75204
@Rafaelaugusto, worked partially... Now it would be necessary to eliminate the white spaces above and below the table.
– user75204
@Rafaelaugusto, how can I align the cell text downwards? <td style:'vertical-align: bottom'>
– user75204
I got... <td style='vertical-align: bottom'>
– user75204
for vh support on browsers go to http://caniuse.com/viewport-units/embed/
– Felipe Duarte