Header Column Alignment

Posted by: johngiblin on 16 November 2020, 4:25 am EST

  • Posted 16 November 2020, 4:25 am EST

    For some reason, the alignment of my grid is not consistent. I see the header columns align right, center and left. See below.

    Is the a setting to align the header column
  • Replied 17 November 2020, 6:29 pm EST

    Hi,

    If we understand correctly you want to set the alignment for columns. For this, you may use cssClass property and set the alignment in the CSS. Please refer to the following code snippet.

    var cols = [
    {
    id: 'title',
    caption: 'Title',
    dataField: 'title',
    cssClass: "center"
    }
    ]
    let dv = new GC.DataViews.DataView(document.getElementById('grid'), data, cols, new GC.DataViews.GridLayout());
    //in Css file
    .center{
    text-align: center;
    }


    Further, if it is not the case. Please explain more about the issue that you are facing so that we could have a better understanding of the issue and assist you accordingly.

    Regards
    Avinash
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels