Author Topic: Display multiple spaces in a HTML Page  (Read 1601 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Display multiple spaces in a HTML Page
« on: November 20, 2019, 08:18:15 pm »
Hi

Have multiple spaces (indentation) in data which I would like to see reflected in grid (  or similiar). When you export though, it should be formatted back to what was returned from db in the beginning.
How can I accomplish in an effecient way?

Thanks in advance.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Display multiple spaces in a HTML Page
« Reply #1 on: November 20, 2019, 09:15:42 pm »
It can be done by adding render callback to the column

Code: [Select]
render: function(ui){
return ui.cellData.replace(/\s/g," ");
}

or a css solution

Code: [Select]
.pq-grid-cell{
white-space:pre-wrap !important;
}