K2 Mobile workspace listview display issue

  • 13 August 2022
  • 1 reply


This is my approach to resolve the issue of listview display on k2 mobile app.

  1. Add a button and a data label to the form.
  2. Make sure that the data label literal checkbox is checked, and “prevent xss” is unchecked
  3. in the click button event add an action to set the properties of the datalabel control
  4. paste the following code:

<script defer>

if (document.readyState == "complete")


const collection = document.getElementsByClassName("grid-content-table zebra-stripes");

for (let i = 0; i < collection.length; i++)


collection[i].style.tableLayout = "auto";




  1. add the form to the “System/Application form” folder
  2. test from k2 workspace mobile app and click the button
  3. test using developer tools
  4. you can try the code in expressions but I prefer this
  5. see the attachment for further explanation


Best Regards,

Bashar Adas. 

1 reply

you can replace the button with any other control with event


Best Regards,

Bashar Adas