fixed the issue. Will look into that further I suspect that when you use .show(), it sets display: inline instead of display: table. Instead of .show(), I would set up two classes, one for show and one for hide, and toggle the class. Alternatively, you could also use:
may help you . It actually does center the div! If you try to put a color to the div you will see that the div actually fills the whole width of the page and is actually centered (or better to say that they have filled the whole that they have no place to move horizontally). divs fill the width of their parent automatically if you don't define a width to them.
text align or margin 0 auto both not working to center div