Dynamically calculate height of table cell