3.2.0

Grid position

Hello

I know how to place a grid in a certain location on the screen

#myGrid .aw-system-control {position: absolute}
#myGrid {left: 100px; top: 100px; position: absolute;}

Could you please guide me how to center the grid in the middle of the screen, especially if I use it in a frame?

Thanks
Erich
Erich Singer
March 5,
If you are using absolute position you can set grid left margin to the half of the grid width (negative) and use 50% left offset -

<style>

    #myGrid {
        position: absolute;
        width: 500px;
        margin-left: -250px; /* half of the object width */
        left: 50%; /* goes to the middle of the page */
        top: 100px;
    }

</style>
<script>

    var obj = new AW.UI.Grid;
    obj.setId("myGrid");
    obj.setCellData("cell");
    obj.setHeaderText("header");
    obj.setColumnCount(10);
    obj.setRowCount(10);
    document.write(obj);

</script>
Alex (ActiveWidgets)
March 6,
Thank you very much for the quick reply
Erich
Erich Singer
March 6,

This topic is archived.

See also:


Back to support forum