Giving height to table and row in Bootstrap

前端 未结 5 1940
说谎
说谎 2020-12-30 23:30

I am using Bootstrap 3 , i am trying to give height to table and row, but nothing is working for me .

I tried setting line-height

5条回答
  •  青春惊慌失措
    2020-12-31 00:01

    For the 's just set

    tr {
       line-height: 25px;
       min-height: 25px;
       height: 25px;
    }
    

    It works with bootstrap also. For the 100% height, 100% must be 100% of something. Therefore, you must define a fixed height for one of the containers, or the body. I guess you want the entire page to be 100%, so (example) :

    body {
        height: 700px;
    }
    .table100, .row, .container, .table-responsive, .table-bordered  {
        height: 100%;
    }
    

    A workaround not to set a static height is by forcing the height in code according to the viewport :

    $('body').height(document.documentElement.clientHeight);
    

    all the above in this fiddle -> http://jsfiddle.net/LZuJt/

    Note : I do not care that you have 25% height on #description, and 100% height on table. Guess it is just an example. And notice that clientHeight is not right since the documentElement is an iframe, but you'll get the picture in your own projekt :)

提交回复
热议问题