jQuery UI Widgets Forums Grid cellsalign – center

This topic contains 3 replies, has 4 voices, and was last updated by  VictorRein 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • cellsalign – center #4270

    AceDZN
    Member

    Hi there!
    is there a way to align the cells content to center ?
    I saw that the only options are left\right – & they added with a “float” method – but I need them to be centered with “margin:auto” or just “text-align” for the wrapper div…
    is there a way to make this happen?
    best regards
    -Alex

    cellsalign – center #4271

    jonathan
    Member

    Hey Alex,

    The following workaround is working for me:

    function layoutCells() {
    $('.jqx-grid-cell').find('span').css({
    float: 'none',
    display: 'block',
    'text-align': 'center'
    });
    }
    $('#jqxgrid').bind('pagechanged', function () {
    layoutCells();
    });
    $('#jqxgrid').bind('bindingcomplete', function () {
    layoutCells();
    });

    Jonathan.

    cellsalign – center #4276

    Peter Stoev
    Keymaster

    Hi Alex and Jonathan,

    Another solution is to use a custom cells rending function. Please, take a look at that help topic: jquery-grid-cellsrendering.htm

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    cellsalign – center #97782

    VictorRein
    Participant

    This would be a nice feature: cellsalign: ‘center’. cellsalign: ‘right’ already works.
    -Victor Reinhart

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.