Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
See pages that link to and include this page.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.
Dear Wikidot Community
Does anyone know how to try and align a 'simple table' on a wiki page from its default position of being "centre" aligned?
I have tried using both [[<]] and [[div style="align: left;"]] types of commands but they dont seem to work.
Here is a sample page of my failed attempts, so you can see how I've used this code:
http://ye-olde-public-test-site.wikidot.com/simple-table-alignment-test
Can anyone tell me what I'm doing wrong or what kind of code I need to make a simple table align to the left?
Thanks in advance for any help with this.
Regards….Ye Olde
Ye Olde - Creator and Chief Admin of www.music-industrapedia.com (Global Music Industry Directory & Encyclopedia) hosted on Wikidot.
This is very easy with a small css module:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Sorry for the brevity of my previous reply, I was in the car in a traffic jam. The css module is fine if all the tables on your page will be left aligned. However, if you want to just have one left aligned then you will need to use a div but as well as the margin would need to specify the width of the div:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Thanks Rob! Your code works for me
I take it that the margin overrides any alignment code in the div?
Ye Olde - Creator and Chief Admin of www.music-industrapedia.com (Global Music Industry Directory & Encyclopedia) hosted on Wikidot.
…sorry I meant to say "replaces" instead of overrides.
Ye Olde - Creator and Chief Admin of www.music-industrapedia.com (Global Music Industry Directory & Encyclopedia) hosted on Wikidot.
No, [[<]] [[>]] [[=]] [[==]] are for aligning text and convert to to text:align:left, text:align:right, text-align:center, text:align:justify. They have no effect on things like tables so are ignored.
In your first post you put [[div style="align: left;"]] which you can't use because align:left doesn't exist in CSS
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
This works too.
[[table style="align:left"]] [[row]] [[cell]]
||~ header ||~ header ||~ header ||
|| cell-content || cell-content || cell-content ||
|| cell-content || cell-content || cell-content ||
[[/cell]][[/row]][[/table]]
Wayne Eddy
Melbourne, Australia
LGAM Knowledge Base
Contact via Google+
Yes that does work and is a good simple solution. But it is not due to align:left. As I said in my previous post, align:left does not exist. The table is being left aligned due to the left margin being set elsewhere in the css. The align:left is just being ignored.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Despite a good look I couldn't see what rule was forcing the table to align to the left. A bit of rootling through the css spec at http://www.w3.org/TR/CSS2/tables.html indicates to me that that by default the table wrapper is left aligned in its containing element by default wth an auto width. So that is why a complex table would align to the left.
A simple table is of course different in that it uses the wiki-content-table class which has margin: 0.5em auto; set in the base css so it will, unless over-ridden, always align to the centre.
So the complex table has width:auto and the the simple table is center aligned inside it which you can't really see because it takes up the whole width.
As I mentioned, align:left is not valid css, so if you removed it from the mixed complex/simple code given by Wayne the result would still be the same.
This mix suggested by Wayne is worth remembering for the future. An interesting discussion.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Thanks the extra detail Rob, and thanks to Wayne too for your input.
Ye Olde - Creator and Chief Admin of www.music-industrapedia.com (Global Music Industry Directory & Encyclopedia) hosted on Wikidot.
Thanks Rob, you are 100% correct. The following works just as well.
[[table]] [[row]] [[cell]]
||~ header ||~ header ||~ header ||
|| cell-content || cell-content || cell-content ||
|| cell-content || cell-content || cell-content ||
[[/cell]][[/row]][[/table]]
I have been using what I shared last time to left justify simple tables for a couple of years, with out really knowing why its works.
Wayne Eddy
Melbourne, Australia
LGAM Knowledge Base
Contact via Google+
Asking here as I'm similarly stumped: anyone know how to do the opposite, and make a custom table itself (not just the text in its cells) centralised instead of left-aligned?
To center a table you use margin: 0 auto; which sets the margins above and below the table to 0 and sets an auto margin for left and right margins which has the effect of centering the table. You could increase the margin above and below the table by changing the zero to a different figure.
So the css to center a simple table would be:
To center a complex table (the table itself, not the contents of each cell) you would use:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.