26 Replies Latest reply: Sep 24, 2014 10:04 PM by Chris Olver RSS

    Center Align Document Extension

    Brian Munz

      I've often heard requests for an extension that can center align a QlikView document, and I recently built one for the Global Games app.

      One difference between that one and the one I'm posting here, is that that version also places a new background image on the page.

       

      So, non-technically, this extension will take your app and align it to the center of the window, including the tabs.  It also centers any background image on the app as well, so if you have a background image that is wider than the content area of the app, it could cause that background image to look strange.

       

      A little more technically...since QV uses all absolutely positioned elements, it's difficult to determine the width of the content area, but I was able to do that in this extension in order to center it.  The one issue is that if there is a smaller width the content area, it will center based on that small area and look strange.  So, the default width that it sets the document to is 1024 pixels.  If the extension determines the app is wider, it will center properly for that width.

       

      Even more technically...all the extension is really doing is wrapping the content area (the PageContainer div) inside a div with a class of "master."  Then, the extension just determines the content area width, and centers that content in the master div.

       

      ANYway, hopefully this helps some people out.  I haven't tested in QVS yet, but it should work in QVS also.

      Thanks.

       

      EDIT: I modified the extension I originally posted to ensure the aligning updates when switching between sheets of different widths.