From LibreOffice Help
Automatically adjusts row heights to match the contents of the cells. This is the default setting for new tables.
Choose Table - Autofit - Optimal Row Height
Open Optimize Size toolbar from Table Bar, click
|Optimal Row Height|
|This option is only available if the table contains a row with a fixed height.|