Skip to Content

sap.m.Table unable to display with full width when inside a scrollContainer

Hi,

I have an issue where i place a sap.m.table inside a sap.m.ScrollContainer and set the column width as default. In table and mobile display, everything comes as expected. But in desktop version, the table does not display full width and there is a weird gap between the right table border and the browser page. I can set the width of the individual columns as 100% and it works, but then the table looks a little weird and not nicely aligned. Is there another optimal solution where the table fits inside the scrollContainer without having to write custom column width. My code is as follows:

<ScrollContainer class="scrollStyle" width="100%" horizontal="true" vertical="false">

<Table width="100%" growing="true" visible="true" fixedLayout="false"growingThreshold="20" >

<columns>

<Column mergeDuplicates="true"><header><Label text="Column1" /></header></Column>

<Column><header><Label text="Column2" /></header></Column>

<Column><header><Label text="Column3" /></header></Column>

<Column><header><Label text="Column4" /></header></Column>

<Column><header><Label text="Column5" /></header></Column>

<Column><header><Label text="Column6" /></header></Column>

<Column><header><Label text="Column7" /></header></Column>


</columns>

</Table>

</ScrollContainer>

Any suggestions would be highly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 16, 2016 at 06:58 AM

    Hi Abinash,

    Not sure, what the issue might be? Can you create a plunk or JSBin with full code related to Table and ScrollContainer containing data.

    One alternative without scroll container would be: Plunker

    Regards,

    Sai Vellanki.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2016 at 12:07 PM

    Hi Abinash,

    In ScrollContainer's width parameter, use 'rem' instead of '%'

    Regards,

    Vishnu

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.