Centering The Zero DOM Table?

Centering The Zero DOM Table?

qdataqdata Posts: 24Questions: 0Answers: 0
edited August 2011 in General
I copied and sent the following files to my server...
js filee
demo_page.css
demo_table.css
jquery.dataTables.js
dataTables.js

The table is loading, but its not centered like shown on the Zero configuration site:
http://datatables.net/release-datatables/examples/basic_init/zero_config.html

My table is also as wide as the screen.

How do I center the table and reduce the width of the columns?

Thanks!

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    that page puts the table code inside a div named #container (which is inside the body named #dt_example)

    #container is constrained to "800px"
    #container has left and right margin set to "auto", which centers it
    see http://datatables.net/release-datatables/media/css/demo_page.css
    [code]
    #dt_example #container {
    width: 800px;
    margin: 30px auto;
    padding: 0;
    }
    [/code]

    put your table code inside a div named #container and apply the css. you can take the above and remove #dt_example if you wish

    [code]



    ...



    [/code]
This discussion has been closed.