Setting max-height for table cell contents

前端 未结 7 1322
庸人自扰
庸人自扰 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 03:07

    We finally found an answer of sorts. First, the problem: the table always sizes itself around the content, rather than forcing the content to fit in the table. That limits your options.

    We did it by setting the content div to display:none, letting the table size itself, and then in javascript setting the height and width of the content div to the inner height and width of the enclosing td tag. Show the content div. Repeat the process when the window is resized.

提交回复
热议问题