Setting max-height for table cell contents

前端 未结 7 1360
庸人自扰
庸人自扰 2020-12-03 02:06

I have a table which should always occupy a certain percentage of the height of the screen. Most of the rows are of fixed height, but I have one row that should stretch to f

7条回答
  •  醉酒成梦
    2020-12-03 02:46

    Possibly not cross browser but I managed get this: http://jsfiddle.net/QexkH/

    basically it requires a fixed height header and footer. and it absolute positions the table.

        table {
            width: 50%;
            height: 50%;
            border-spacing: 0;
            position:absolute;
        }
        td {
            border: 1px solid black;
        }
        #content {
            position:absolute;
            width:100%;
            left:0px;
            top:20px;
            bottom:20px;
            overflow: hidden;
        }
    

提交回复
热议问题