Material-table: maxBodyHeight does not take a percentage

Created on 9 May 2019  路  2Comments  路  Source: mbrn/material-table

Describe the bug
When trying to have a table fit within a flexible area, providing a string of 'x%' makes the table expand to its full height

To Reproduce
Steps to reproduce the behavior:

  1. provide a maxbodyheight of say 20% inside a div of fixed size

Expected behavior
Table should render to max height of percentage of parent

Desktop (please complete the following information):

  • OS: OSX 1.14
  • Browser Chrome, safari
  • Version 68

** maybe due to overflowY set to auto?

bug

Most helpful comment

maxBodyHeight:'calc(100vh - 190px)' try this (190 is for example you can change based on your requirement)

All 2 comments

Hi @blackbadgerltd ,

Actually this is not a bug. % height could not be applied cause of parent component that is not specified a height.

Trick: You can use maxBodyHeight: '80vh' :)

maxBodyHeight:'calc(100vh - 190px)' try this (190 is for example you can change based on your requirement)

Was this page helpful?
0 / 5 - 0 ratings