Skip to Content
Aug 28, 2019 at 09:59 AM

SAPUI5 - Make table column auto fit content


Hello all,

I'm looking for a way in SAPUI5 to make a table of which the columns will automatically resize depending on the content in that column. This should work on any screen size.

So if the total width of the columns exceeds the width of the screen, there should be a scrollbar that allows the user to scroll horizontally through the table columns.

I've searched the internet for a solution, but didn't find anything that comes close to what I want.

Preferably, I would like to use sap.ui.table.Table, but if it can only be achieved with sap.m.Table, that's fine as well.

Environment runs on SAPUI5 version 1.60.13.

Any input, suggestions or remarks are more than welcome!

Thanks in advance!