:: Forum >>

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
Monday, March 5, 2007
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)
Tuesday, March 6, 2007
Thank you very much for the quick reply
Erich
Erich Singer
Tuesday, March 6, 2007

This topic is archived.


Back to support forum

Forum search