How does one center a whole table?

The_Warlock
The_Warlock
edited October 2013 in Campaign Portal Building
So, there has to be a way to center a whole table, not the text, but the columnar location of the table on the page. I've tried every inline and CSS blivit and blurb I can find and nadda. How in the bloody heck does one do this? While progress is nice, I long for the days of ancient HTML when I could just say and be done with it.

Comments

  • Langy
    Langy
    Posts: 364
    Use:

    table .class-of-table {
    margin-left:auto;
    margin-right:auto;
    }

    That is, if you're putting class="class-of-table" in the table's declaration. If you're not, just use style="margin-left:auto;margin-right:auto".
  • Savannah
    Savannah
    Posts: 188
    There is a quick and easy way to center all tables if you have access to CSS. Add this to your campaign's CSS area:

    bc. table {margin:0px auto;}

    If you want only some tables centered, however, I don't know of an easy way. You could make a specific class of centered tables in the CSS, but I think you'd have to write the table itself in HTML for it to apply, which would really suck.
  • The_Warlock
    The_Warlock
    Posts: 6
    Ok, Langy, when you say, 'just use style=“margin-left:auto;margin-right:auto”.', where precisely do I put that? Before the table on a individual page? Or do you mean as a way to affect everything in one page, or in the CSS block to affect the whole site? Because I jut have individual tables I want to center. If I use the first, what precisely is a 'table's declaration'? I'm a hardware/software techie, not a coder techie...it's like swahili to me.
  • madartiste
    madartiste
    Posts: 328 edited October 2013
    Warlock,
    Inline CSS looks something like


    All your table coding goes in here
    More table stuff


    I don't think you can use it with the textile code for tables...
    Here's more about HTML tables if you've never tried to code one before: "HTML Tables":http://www.w3schools.com/html/html_tables.asp
    Post edited by madartiste on
  • Langy
    Langy
    Posts: 364
    You can use CSS with textile code for tables. Just do it like this:

    table(css-class){style-stuff}.
    | Table Text | Goes Here |

    So if you can't use CSS classes, do it as:

    table{margin-left:auto;margin-right:auto}.
    | Table Text | Goes Here |
  • The_Warlock
    The_Warlock
    Posts: 6
    Thank you all, that is precisely what I needed to know! And now the tables in question do exactly what I want...thanks!
Sign In or Register to comment.

September 2026
City of Shadows

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions