Layout With Tables

By michal frackowiakmichal frackowiak

Description

A nice way to add advanced layout control using the [[table]] tag. The example uses the style attribute for the whole table and particular cells to adjust layout.

Code

[[table style="margin: 0 10px;"]]
[[row]]
[[cell style="padding: 10px; background-color: #DDDDEE; border: 1px solid silver; width: 50%;"]]

+++ example cell

Lorem ipsum dolor sit amet...

[[/cell]]
[[cell style="padding: 10px; background-color: #DDEEDD; border: 1px solid silver"]]

Lorem ipsum dolor sit amet...

[[/cell]]
[[/row]]
[[row]]
[[cell style="padding: 10px; background-color: #DDEEDD; border: 1px solid silver"]]

+++ another cell

Lorem ipsum dolor sit amet...

[[/cell]]
[[cell style="padding: 10px; background-color: #DDDDEE; border: 1px solid silver"]]

+++ Flickr Gallery module inside

[[module FlickrGallery tags="linux,sun" tagMode="all" perPage="6" limit="12" limitPages="1"]]

[[/cell]]
[[/row]]
[[/table]]

In action

example cell

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.

Quisque facilisis erat a dui. Nam malesuada ornare dolor. Cras gravida, diam sit amet rhoncus ornare, erat elit consectetuer erat, id egestas pede nibh eget odio. Proin tincidunt, velit vel porta elementum, magna diam molestie sapien, non aliquet massa pede eu diam. Aliquam iaculis. Fusce et ipsum et nulla tristique facilisis.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.

Quisque facilisis erat a dui. Nam malesuada ornare dolor. Cras gravida, diam sit amet rhoncus ornare, erat elit consectetuer erat, id egestas pede nibh eget odio. Proin tincidunt, velit vel porta elementum, magna diam molestie sapien, non aliquet massa pede eu diam. Aliquam iaculis. Fusce et ipsum et nulla tristique facilisis.

another cell

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.

Flickr Gallery module inside

As you might notice, using the [[table]] you can easily create the Wikipedia-style front pages.

Rate this solution

If you think this solution is useful — rate it up! Or dump it otherwise.

rating: +103+x
How do you column span with this?
uiriseuirise 1192837037|%e %b %Y, %H:%M %Z|agohover

I'm trying to make the equivalent to the wikidot.com table of

header
col 1 col 2

Is there any way this can be done?

unfold How do you column span with this? by uiriseuirise, 1192837037|%e %b %Y, %H:%M %Z|agohover
Re: How do you column span with this?
PizzaGeekPizzaGeek 1193019055|%e %b %Y, %H:%M %Z|agohover

Through some trial and error, I came up with this as one solution:
Mimic Colspan With Multiple Tables

unfold Re: How do you column span with this? by PizzaGeekPizzaGeek, 1193019055|%e %b %Y, %H:%M %Z|agohover
Re: How do you column span with this?
michal frackowiakmichal frackowiak 1193060062|%e %b %Y, %H:%M %Z|agohover

We are working to include colspan too.


Michał Frąckowiak @ Wikidot Inc.
Visit my blog at michalf.me

unfold Re: How do you column span with this? by michal frackowiakmichal frackowiak, 1193060062|%e %b %Y, %H:%M %Z|agohover
Re: How do you column span with this?
makimaki 1209911322|%e %b %Y, %H:%M %Z|agohover

Another solution is to nest a two-column table in the second row.


Help in the forum is easier with screenshots: http://community.wikidot.com/forum_screenshots

unfold Re: How do you column span with this? by makimaki, 1209911322|%e %b %Y, %H:%M %Z|agohover
SadrSadr 1194731721|%e %b %Y, %H:%M %Z|agohover

what would also be great is if there could be certain pre-defined styles to choose between, so that you could just put it into the table tag and don't worry about the rest.

unfold by SadrSadr, 1194731721|%e %b %Y, %H:%M %Z|agohover
How do you row span a table?
elfgohelfgoh 1199468662|%e %b %Y, %H:%M %Z|agohover

Anyway to do rowspanning?

unfold How do you row span a table? by elfgohelfgoh, 1199468662|%e %b %Y, %H:%M %Z|agohover
Re: How do you row span a table?
Waldir LeoncioWaldir Leoncio 1212667309|%e %b %Y, %H:%M %Z|agohover

I wanna know that too! :)

unfold Re: How do you row span a table? by Waldir LeoncioWaldir Leoncio, 1212667309|%e %b %Y, %H:%M %Z|agohover
Re: How do you row span a table?
RobWmnRobWmn 1220721486|%e %b %Y, %H:%M %Z|agohover

And me - row span please

unfold Re: How do you row span a table? by RobWmnRobWmn, 1220721486|%e %b %Y, %H:%M %Z|agohover
Text Vertical Alignment Instead of Middle?
albaumalbaum 1201499921|%e %b %Y, %H:%M %Z|agohover

Is there a way to valign the text?

unfold Text Vertical Alignment Instead of Middle? by albaumalbaum, 1201499921|%e %b %Y, %H:%M %Z|agohover
Re: Text Vertical Alignment Instead of Middle?
elishapetersonelishapeterson 1202349188|%e %b %Y, %H:%M %Z|agohover

use
[[row style="vertical-align:top"]]

unfold Re: Text Vertical Alignment Instead of Middle? by elishapetersonelishapeterson, 1202349188|%e %b %Y, %H:%M %Z|agohover
Re: Text Vertical Alignment Instead of Middle?
David MarseillesDavid Marseilles 1213215501|%e %b %Y, %H:%M %Z|agohover

I didn't even know how to ask this question. Thanks both of you. =)

unfold Re: Text Vertical Alignment Instead of Middle? by David MarseillesDavid Marseilles, 1213215501|%e %b %Y, %H:%M %Z|agohover
Re: Text Vertical Alignment Instead of Middle?
leigerleiger 1247912532|%e %b %Y, %H:%M %Z|agohover

Thanks! Just what I was looking for :)


— Shane | Blog | CycloDS Revolution | Compatibility List | Get your free Wiki! | XBL: leiger40
100% Wikidot. 100% Awesome.

unfold Re: Text Vertical Alignment Instead of Middle? by leigerleiger, 1247912532|%e %b %Y, %H:%M %Z|agohover
Is there any way to align an entire table?
StitchyStitchy 1202441029|%e %b %Y, %H:%M %Z|agohover

… Such as, if I wanted to create a basic character profile to sit on the right side of a page, which is often used on Wikipedia.

unfold Is there any way to align an entire table? by StitchyStitchy, 1202441029|%e %b %Y, %H:%M %Z|agohover
Re: Is there any way to align an entire table?
StitchyStitchy 1202622117|%e %b %Y, %H:%M %Z|agohover

Nevermind. I figured it out myself. c:

unfold Re: Is there any way to align an entire table? by StitchyStitchy, 1202622117|%e %b %Y, %H:%M %Z|agohover
Re: Is there any way to align an entire table?
cold_blood3dcold_blood3d 1204594040|%e %b %Y, %H:%M %Z|agohover

how?

unfold Re: Is there any way to align an entire table? by cold_blood3dcold_blood3d, 1204594040|%e %b %Y, %H:%M %Z|agohover
Cell Width in Tables
KathrynBKathrynB 1204804481|%e %b %Y, %H:%M %Z|agohover

How can I specify the cell width in a table?

unfold Cell Width in Tables by KathrynBKathrynB, 1204804481|%e %b %Y, %H:%M %Z|agohover
Re: Cell Width in Tables
KathrynBKathrynB 1204805837|%e %b %Y, %H:%M %Z|agohover

Don't worry - I have managed to work it out!

unfold Re: Cell Width in Tables by KathrynBKathrynB, 1204805837|%e %b %Y, %H:%M %Z|agohover
Tables inside Tab View
Nathan BenjaminNathan Benjamin 1206655123|%e %b %Y, %H:%M %Z|agohover

Can it be done?

unfold Tables inside Tab View by Nathan BenjaminNathan Benjamin, 1206655123|%e %b %Y, %H:%M %Z|agohover
Does anyone know how to get the entire table to left align?
crazyhappeningscrazyhappenings 1209491529|%e %b %Y, %H:%M %Z|agohover

Does anyone know how to get the entire table to left align? I have a page full of text and columns that left align, but my table looks funny way out in the middle of the page. Does anyone how how to change this? Thanks.

Here's the table I want on the left side of the page: Does anyone know how to get the entire table to left align? http://bostonhash.wikidot.com/mismanagement

Re: Does anyone know how to get the entire table to left align?
SeiraryuSeiraryu 1209570096|%e %b %Y, %H:%M %Z|agohover

Try [[table style="align:left"]]

Re: Does anyone know how to get the entire table to left align?
aolivezaolivez 1210995642|%e %b %Y, %H:%M %Z|agohover

Clarification: so your source would look like this?

[[table style="align:left"]]
@|| cell 1 || cell 2 ||@

I also tried:
[[<]] … [[/<]]

to no avail!

Re: Does anyone know how to get the entire table to left align?
ickabodickabod 1213285537|%e %b %Y, %H:%M %Z|agohover

You need to use the [[table]] syntax for this to work. You can't mismatch.

Here is an example:

[[table style="align:left"]]
[[row]][[cell]] row1 cell1 [[/cell]][[cell]] row1 cell2]][[/row]]
[[row]][[cell]] row2 cell1 [[/cell]][[cell]] row2 cell2]][[/row]]
[[/table]]

Re: Does anyone know how to get the entire table to left align?
lindseymoonlindseymoon 1218088010|%e %b %Y, %H:%M %Z|agohover

Um, that doesn't work.

Re: Does anyone know how to get the entire table to left align?
dennywdennyw 1218218870|%e %b %Y, %H:%M %Z|agohover

I stumbled on to this syntax and it worked for me

[[table style="align:left"]] [[row]] [[cell]]
|| Foobar || Foobash || Foobang ||
|| bar 1 || bash  1 || bang 1 ||
|| bar 2 || bash  2 || bang 2 ||
[[/cell]][[/row]][[/table]]
Foobar Foobash Foobang
bar 1 bash 1 bang 1
bar 2 bash 2 bang 2
Re: Does anyone know how to get the entire table to left align?
TanaxTanax 1222396695|%e %b %Y, %H:%M %Z|agohover

Genius!

Re: Does anyone know how to get the entire table to left align?
westmoquettewestmoquette 1225195103|%e %b %Y, %H:%M %Z|agohover

That's exactly what I was trying to find!

Re: Does anyone know how to get the entire table to left align?
KathKath 1239900340|%e %b %Y, %H:%M %Z|agohover

Exactly what I was looking for too. Thanks.

Re: Does anyone know how to get the entire table to left align?
elishapetersonelishapeterson 1239902429|%e %b %Y, %H:%M %Z|agohover

Here's another solution:

[[div style="width:0"]]
|| Foobar || Foobash || Foobang ||
|| bar 1 || bash  1 || bang 1 ||
|| bar 2 || bash  2 || bang 2 ||
[[/div]]
Foobar Foobash Foobang
bar 1 bash 1 bang 1
bar 2 bash 2 bang 2
span not rows but colomns
Henrik D SILBERSTEINHenrik D SILBERSTEIN 1209834207|%e %b %Y, %H:%M %Z|agohover

Hi, I need to create a table where in one colomn, the content applies to several rows, is it possible to span the colomn rather than a row ? Thanks

unfold span not rows but colomns by Henrik D SILBERSTEINHenrik D SILBERSTEIN, 1209834207|%e %b %Y, %H:%M %Z|agohover
Centering Text/Images
MirayeMiraye 1211163139|%e %b %Y, %H:%M %Z|agohover

Could anyone tell me how to centre the images and text in my cells? Tried [[cell style=" align: center;"]]

unfold Centering Text/Images by MirayeMiraye, 1211163139|%e %b %Y, %H:%M %Z|agohover
Re: Centering Text/Images
SanguinitySanguinity 1216822496|%e %b %Y, %H:%M %Z|agohover

You can center a line of text by beginning the line with "= ". Similarly, you can center an image with [[=image... ]]. I haven't yet discovered a way of centering the contents of an entire cell.

unfold Re: Centering Text/Images by SanguinitySanguinity, 1216822496|%e %b %Y, %H:%M %Z|agohover
Re: Centering Text/Images
GabrysGabrys 1219180768|%e %b %Y, %H:%M %Z|agohover

you can use

style="text-align: center"
style="text-align: left"
style="text-align: right"

for horizontal align, or

style="vertical-align: top"
style="vertical-align: bottom"

for vertical, you can mix:

style="text-align: center; vertical-align: bottom"

hope this helps!


Piotr Gabryjeluk
visit my blog

unfold Re: Centering Text/Images by GabrysGabrys, 1219180768|%e %b %Y, %H:%M %Z|agohover
Headers
BaltarBaltar 1212954087|%e %b %Y, %H:%M %Z|agohover

<table> = [[table]]
<tr> = [[row]]
<td> = [[cell]]
<th> = ???

unfold Headers by BaltarBaltar, 1212954087|%e %b %Y, %H:%M %Z|agohover
Re: Headers
deanfitzdeanfitz 1237995285|%e %b %Y, %H:%M %Z|agohover

is there a solution to this lack of <th> wiki tag yet?

unfold Re: Headers by deanfitzdeanfitz, 1237995285|%e %b %Y, %H:%M %Z|agohover
Re: Headers
Ed JohnsonEd Johnson 1237998764|%e %b %Y, %H:%M %Z|agohover

According to W3Schools:

The text in a th element is bold and centered.

The text in a td element is regular and left-aligned.

A solution for mimicing <th> header cells you can use inline would be:
[[cell style="font-weight:bold; text-align: center;"]]
For example:

[[table style="align: left; border: 2px solid black; border-collapse: collapse;"]]
[[row]]
[[cell style="font-weight:bold; text-align: center; border-bottom: 2px solid black;"]] Header 1 [[/cell]]
[[cell style="font-weight:bold; text-align: center; border-bottom: 2px solid black;"]] Header 2 [[/cell]]
[[/row]]
[[row]]
[[cell]] Content 1 [[/cell]]
[[cell]] Content 2 [[/cell]]
[[/row]]
[[row]]
[[cell]] More Content 1 [[/cell]]
[[cell]] More Content 2 [[/cell]]
[[/row]]
[[/table]]
Header 1 Header 2
Content 1 Content 2
More Content 1 More Content 2

Personally, I like to format the header cells myself since I prefer to have my headers line up with the type of content in the rows below. Right aligned for numbers, left aligned for text and centered where that looks best.
-Ed

unfold Re: Headers by Ed JohnsonEd Johnson, 1237998764|%e %b %Y, %H:%M %Z|agohover
Maven08Maven08 1218234068|%e %b %Y, %H:%M %Z|agohover

How to implement sorting by one column? Twiki supports it.

unfold by Maven08Maven08, 1218234068|%e %b %Y, %H:%M %Z|agohover
Androide23Androide23 1219062703|%e %b %Y, %H:%M %Z|agohover

Hi
I want to get rid of the space between the cells when I put background colors, like in this example:

call 0.0 call 0.1
call 1.0 call 1.1

Is there any way of deleting the cell-spacing?
I have tried with padding=0, margin=0 and border=0, with no success… any ideas?
Cheers

unfold by Androide23Androide23, 1219062703|%e %b %Y, %H:%M %Z|agohover
Re:
Androide23Androide23 1219063769|%e %b %Y, %H:%M %Z|agohover

Ok, I figured this out: I need to write

[[table style=" border-collapse: collapse;" ]] ...
unfold Re: by Androide23Androide23, 1219063769|%e %b %Y, %H:%M %Z|agohover
Re:
GabrysGabrys 1219180791|%e %b %Y, %H:%M %Z|agohover

Exactly!


Piotr Gabryjeluk
visit my blog

unfold Re: by GabrysGabrys, 1219180791|%e %b %Y, %H:%M %Z|agohover
Re:
draco963draco963 1219276570|%e %b %Y, %H:%M %Z|agohover

Love the border-collapse. Is there a list of all the different Style commands somewhere?

unfold Re: by draco963draco963, 1219276570|%e %b %Y, %H:%M %Z|agohover
Re:
RobWmnRobWmn 1220721377|%e %b %Y, %H:%M %Z|agohover

You just need a CSS reference page like Here and here. Before you get too fancy though you should find out about the issues with CSS implementation - i.e. not everything will work as you expect because different browsers don't always do what they should - and the fancier you get the more you are asking for trouble.

unfold Re: by RobWmnRobWmn, 1220721377|%e %b %Y, %H:%M %Z|agohover
Scroll Bar
VashTexanVashTexan 1220729523|%e %b %Y, %H:%M %Z|agohover

Does anybody have any idea how to implement a scroll bar around a table? My table is too wide and stretches past the right edge of the whole web page and it looks like a mess.

I've found out how: just make a div box around the table with the parameter overflow:auto;. Note that using a div box with tabs may cause some problems, but I posted some workarounds in the tabs page comments.

[[div style="float:left; width:100%; height:600px; text-align: left; top:100px; overflow:auto; padding: 10px;"]]
last edited on 1220817690|%e %b %Y, %H:%M %Z|agohover by VashTexan + show more
unfold Scroll Bar by VashTexanVashTexan, 1220729523|%e %b %Y, %H:%M %Z|agohover
how can I add the symbol || in a cell of a table
bio_amateurbio_amateur 1229275554|%e %b %Y, %H:%M %Z|agohover

Any one can help me to create a table in which the || is not recognized as the cell division, I want || to appear as a text in a cell.

unfold how can I add the symbol || in a cell of a table by bio_amateurbio_amateur, 1229275554|%e %b %Y, %H:%M %Z|agohover
Re: how can I add the symbol || in a cell of a table
Helmuti_pdorfHelmuti_pdorf 1231484541|%e %b %Y, %H:%M %Z|agohover

use the "@@" ( double @) as delimiter - this switch off the wikidot renderer..

like

@@||@@

which gives
||


Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)

Wollen Sie Wikidot helfen im deutschen » Handbuch ?

Changing Heading color
BBCaT94BBCaT94 1231463160|%e %b %Y, %H:%M %Z|agohover

Is there a way to change the color of the heading text while still keeping a background color? I've tried several different codes and nothing worked.

unfold Changing Heading color by BBCaT94BBCaT94, 1231463160|%e %b %Y, %H:%M %Z|agohover
Re: Changing Heading color
Helmuti_pdorfHelmuti_pdorf 1231484812|%e %b %Y, %H:%M %Z|agohover

You can change in every "Level" ( means table, row, cell) the attribute style="….;color:blue; background-color:yellow" (or use the RGB Codes xFF0000 ; x0000FF instead of the "text" codes)..

Have a look on the http://community.wikidot.com/howto:howto:embelish-text:examples for the style attributes
and on the http://community.wikidot.com/howto:table-layout-with-row-and-cell for the table usages

And: read the posts here in the comments ….

Edit:
Another tip: got to the Community site and enter "table header color" in the search field at the start window.. you will get exact the info you need! ( with the very new search function)


Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)

Wollen Sie Wikidot helfen im deutschen » Handbuch ?

last edited on 1231486064|%e %b %Y, %H:%M %Z|agohover by Helmuti_pdorf + show more
unfold Re: Changing Heading color by Helmuti_pdorfHelmuti_pdorf, 1231484812|%e %b %Y, %H:%M %Z|agohover
Re: Changing Heading color
BBCaT94BBCaT94 1231851801|%e %b %Y, %H:%M %Z|agohover

Thanks for the info. I'll definitely look it over.

unfold Re: Changing Heading color by BBCaT94BBCaT94, 1231851801|%e %b %Y, %H:%M %Z|agohover
Any way to hide an un-used row?
NikNaksNikNaks 1234442594|%e %b %Y, %H:%M %Z|agohover

I've got a template set up with content variables, but sometimes a row in the table is unnecessary. If I set that as the last content number, is there any way for it to be hidden if it's not used?

unfold Any way to hide an un-used row? by NikNaksNikNaks, 1234442594|%e %b %Y, %H:%M %Z|agohover
Re: Any way to hide an un-used row?
Helmuti_pdorfHelmuti_pdorf 1234445068|%e %b %Y, %H:%M %Z|agohover

I am not sure if this can help:
http://community.wikidot.com/howto:set-up-an-infobox

http://community.wikidot.com/howto:set-up-an-infobox-exclude-specific-attributes


Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)

Wollen Sie Wikidot helfen im deutschen » Handbuch ?

unfold Re: Any way to hide an un-used row? by Helmuti_pdorfHelmuti_pdorf, 1234445068|%e %b %Y, %H:%M %Z|agohover
Vertical Alignment issue
Ai-DealerAi-Dealer 1235759658|%e %b %Y, %H:%M %Z|agohover

On PC's running XP and IE7, the [[table style="vertical-align: top"]] command is being ignored.

I don't really need a table and the issue may be that the rows of images are too wide for a 1024px x 768px screen… but whether in a table as shown or not on a table with the same style command applied to the images…

I am getting a huge block of white space before my images and content (which all floats to the bottom)… it is formatted correctly, but is waaaayyyy down.

BTW, it looks + works great on a wider screen and on my Vista machine. It also works great on the same Windows machine in Firefox….aaauuuggghhhh

Here is the link:

http://www.auto-grok.com/2008-gm-saturn-astra-grok

unfold Vertical Alignment issue by Ai-DealerAi-Dealer, 1235759658|%e %b %Y, %H:%M %Z|agohover
Re: Vertical Alignment issue
makimaki 1235815161|%e %b %Y, %H:%M %Z|agohover

I looks normal in Opera, too.

Have you tried "vertical-align: top" in the cell style?


Help in the forum is easier with screenshots: http://community.wikidot.com/forum_screenshots

unfold Re: Vertical Alignment issue by makimaki, 1235815161|%e %b %Y, %H:%M %Z|agohover
Aligning Text In a Cell
maltheopiamaltheopia 1240090085|%e %b %Y, %H:%M %Z|agohover

I want to align the contents in a cell so that one phrase is aligned to the left and the other phrase is aligned to the right.

For example:

##Code Phrase Alpha~~~~~~~~~~Code Phrase Beta##
##Code Phrase Charlie~~~~Code Phrase December##

How do I do that?

last edited on 1240090273|%e %b %Y, %H:%M %Z|agohover by maltheopia + show more
unfold Aligning Text In a Cell by maltheopiamaltheopia, 1240090085|%e %b %Y, %H:%M %Z|agohover
Re: Aligning Text In a Cell
GabrysGabrys 1240090547|%e %b %Y, %H:%M %Z|agohover

You need to use [[table]] syntax and play with CSS using [[div]]s

Try something like this:

aligned to left

aligned to right

loooooooooooooooooooooooooooooong ceeeeeeeeeeeeeeeeeeeeeeeeeeeeeell

Code:

[[table class="wiki-content-table"]]
[[row]]
[[cell]]
[[div style="float: left"]]
aligned to left
[[/div]]
[[div style="float: right"]]
aligned to right
[[/div]]
[[/cell]]
[[/row]]
[[row]]
[[cell]]
loooooooooooooooooooooooooooooong ceeeeeeeeeeeeeeeeeeeeeeeeeeeeeell
[[/cell]]
[[/row]]
[[/table]]

Piotr Gabryjeluk
visit my blog

last edited on 1240090595|%e %b %Y, %H:%M %Z|agohover by Gabrys + show more
unfold Re: Aligning Text In a Cell by GabrysGabrys, 1240090547|%e %b %Y, %H:%M %Z|agohover
Re: Aligning Text In a Cell
maltheopiamaltheopia 1240090823|%e %b %Y, %H:%M %Z|agohover

The 'Float' thing works just awesome. I wish I had discovered it earlier; it would've saved me a lot of trouble.

Thanks, guy.

unfold Re: Aligning Text In a Cell by maltheopiamaltheopia, 1240090823|%e %b %Y, %H:%M %Z|agohover
Need to have two tables next to each other
HobStarCSHobStarCS 1240873179|%e %b %Y, %H:%M %Z|agohover

Hi all, I need to get two tables next to each other. Table one has 4 columns and 8 rows, table two has 3 columns and 8 rows. I was hoping to have a small space between the two tables. I am new to Wiki's in general and new to 'Advanced Tables' so I hope that someone can help.

unfold Need to have two tables next to each other by HobStarCSHobStarCS, 1240873179|%e %b %Y, %H:%M %Z|agohover
Re: Need to have two tables next to each other
Ed JohnsonEd Johnson 1240877388|%e %b %Y, %H:%M %Z|agohover

You could float the 2 tables, but that could get messy if the browser window isn't wide enough to display them side-by-side. You might try making a single table that is 8 columns wide, leaving column 5 empty to serve as your spacer like this:

Header 1 Header 2 Header 3 Header 4 Header 6 Header 7 Header 8
content 1 content 2 content 3 content 4 content 6 content 7 content 8
content 1 content 2 content 3 content 4 content 6 content 7 content 8

and so on…

You can specify column width, add cell padding, etc. in the style definitions.

[[table style="align: left; border: none; border-collapse: collapse;"]]
[[row]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 1 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 2 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 3 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 4 [[/cell]]
[[cell style="font-weight:bold; border: none; width: 10px;"]] [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 6 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 7 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 8 [[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid silver;"]] content 1 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 2 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 3 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 4 [[/cell]]
[[cell style="border: none;"]] [[/cell]]
[[cell style="border: 1px solid silver;"]] content 6 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 7 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 8 [[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid silver;"]] content 1 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 2 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 3 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 4 [[/cell]]
[[cell style="border: none;"]] [[/cell]]
[[cell style="border: 1px solid silver;"]] content 6 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 7 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 8 [[/cell]]
[[/row]]
[[/table]]

-Ed

unfold Re: Need to have two tables next to each other by Ed JohnsonEd Johnson, 1240877388|%e %b %Y, %H:%M %Z|agohover
Re: Need to have two tables next to each other
HobStarCSHobStarCS 1240895591|%e %b %Y, %H:%M %Z|agohover

Thanks heaps Ed, that did the trick. I can see how I can use this to also make 3 or even 4 tables next to each other.

unfold Re: Need to have two tables next to each other by HobStarCSHobStarCS, 1240895591|%e %b %Y, %H:%M %Z|agohover
Re: Need to have two tables next to each other
HobStarCSHobStarCS 1240897526|%e %b %Y, %H:%M %Z|agohover

It is working great, just wondered if I can decrease the space between the two tables?

[[cell style="border: none;"]] [[/cell]]
unfold Re: Need to have two tables next to each other by HobStarCSHobStarCS, 1240897526|%e %b %Y, %H:%M %Z|agohover
Re: Need to have two tables next to each other
Ed JohnsonEd Johnson 1240920853|%e %b %Y, %H:%M %Z|agohover

You can set the width of the blank column (or any column for that matter) of cells in px, % or em:

[[cell style="border: none; width: 5px;"]][[/cell]]

You can also rip out the space character in the cell which should allow it to get as narrow as possible with now specific width setting. You'll notice in my example above, I just set the width in the first row and the rows below pick up that setting. You can totally remove the width setting and the "spacer" column will be very narrow. I added the width in my example above to make the spacer more visible. Here's the same example above with no width setting and null cells in the spacer column:
Header 1 Header 2 Header 3 Header 4 Header 6 Header 7 Header 8
content 1 content 2 content 3 content 4 content 6 content 7 content 8
content 1 content 2 content 3 content 4 content 6 content 7 content 8
[[table style="align: left; border: none; border-collapse: collapse;"]]
[[row]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 1 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 2 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 3 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 4 [[/cell]]
[[cell style="font-weight:bold; border: none;"]][[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 6 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 7 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver;"]] Header 8 [[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid silver;"]] content 1 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 2 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 3 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 4 [[/cell]]
[[cell style="border: none;"]][[/cell]]
[[cell style="border: 1px solid silver;"]] content 6 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 7 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 8 [[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid silver;"]] content 1 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 2 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 3 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 4 [[/cell]]
[[cell style="border: none;"]][[/cell]]
[[cell style="border: 1px solid silver;"]] content 6 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 7 [[/cell]]
[[cell style="border: 1px solid silver;"]] content 8 [[/cell]]
[[/row]]
[[/table]]

[edit: I should also mention that Gerdami's excellent Excel utility to create Wikidot simple or complex table code is a great tool for managing your table content. If you haven't seen it, you should check it out: http://community.wikidot.com/howto:import-simple-excel-tables-into-wikidot]. Version 2 is the one you want for "complex" tables (generates the type of code with styles we're talking about here).

-Ed

last edited on 1240921527|%e %b %Y, %H:%M %Z|agohover by Ed Johnson + show more
unfold Re: Need to have two tables next to each other by Ed JohnsonEd Johnson, 1240920853|%e %b %Y, %H:%M %Z|agohover
Forcing a Return
Evelyn SloanEvelyn Sloan 1246382236|%e %b %Y, %H:%M %Z|agohover

Is there any way to 'force' a return in a cell? For instance, in one cell I have a list of items, I want the items to each be on a separate line, but not in different cells. Appreciate any help.

unfold Forcing a Return by Evelyn SloanEvelyn Sloan, 1246382236|%e %b %Y, %H:%M %Z|agohover
Re: Forcing a Return
Ed JohnsonEd Johnson 1246383354|%e %b %Y, %H:%M %Z|agohover

You need to use the "space, underscore" trick like so:

Header 1 Header 2 Header 3 Header 4
list 1, row 1
list 1, row 2
list 1, row 3
list 1, row 4
list 2, row 1
list 2, row 2
list 2, row 3
list 3, row 1
list 3, row 2
list 3, row 3
list 3, row 4
list 3, row 5
list 4, row 1
list 4, row 2
list 4, row 3
list 4, row 4

Depending on your layout and desired look, you may need to play with the vertical alignment as well. Here's the code for the above table:

[[table style="align: left; border: none; border-collapse: collapse;"]]
[[row]]
[[cell style="font-weight:bold; border: 1px solid silver; padding:5px;"]] Header 1 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver; padding:5px;"]] Header 2 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver; padding:5px;"]] Header 3 [[/cell]]
[[cell style="font-weight:bold; border: 1px solid silver; padding:5px;"]] Header 4 [[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid silver; padding:5px;"]]
list 1, row 1 _
list 1, row 2 _
list 1, row 3 _
list 1, row 4
[[/cell]]
[[cell style="border: 1px solid silver; padding:5px;"]]
list 2, row 1 _
list 2, row 2 _
list 2, row 3
[[/cell]]
[[cell style="border: 1px solid silver; padding:5px;"]]
list 3, row 1 _
list 3, row 2 _
list 3, row 3 _
list 3, row 4 _
list 3, row 5
[[/cell]]
[[cell style="border: 1px solid silver; padding:5px;"]]
list 4, row 1 _
list 4, row 2 _
list 4, row 3 _
list 4, row 4
[[/cell]]
[[/row]]
[[/table]]

-Ed
unfold Re: Forcing a Return by Ed JohnsonEd Johnson, 1246383354|%e %b %Y, %H:%M %Z|agohover
Re: Forcing a Return
Helmuti_pdorfHelmuti_pdorf 1246830336|%e %b %Y, %H:%M %Z|agohover

http://www.wikidot.com/doc:wiki-syntax#toc11 - the underscore trick


Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)

Wollen Sie Wikidot helfen im deutschen » Handbuch ?

unfold Re: Forcing a Return by Helmuti_pdorfHelmuti_pdorf, 1246830336|%e %b %Y, %H:%M %Z|agohover
Specifying Cell Width for a Header Cell?
Kitsune-DASKitsune-DAS 1255249864|%e %b %Y, %H:%M %Z|agohover

I'm having a little bit of issue getting one of my tables to cooperate… I've decided to use Wikidot to post my D&D character sheets, and one of the tables just isn't behaving.

[[table style="align:left"]] [[row]] [[cell]]
||~ **Experience**|||||| 6765 xp||
||~ **Total Hit Points** _
**Current**||||||31 _
31||
||~ **AC**|| 17||||10 +3 [armor bonus] +3 [dex] @@[[@@Touch: -armor; Flat-footed: -dex@@]]@@||
||~ **Touch AC**||13||~ **Flat-footed AC**||14||
[[/cell]][[/row]][[/table]]

gets me
Experience 6765 xp
Total Hit Points
Current
31
31
AC 17 10 +3 [armor bonus] +3 [dex] [[Touch: -armor; Flat-footed: -dex]]
Touch AC 13 Flat-footed AC 14

Mostly it's what I want, but the cell for "Flat-footed AC" is way longer than I'd like…

I've also tried

[[table style="align:left"]] [[row]] [[cell]]
||~ **Experience**|||||| 6765 xp||
||~ **Total Hit Points** _
**Current**||||||31 _
31||
||~ **AC**|| 17||||10 +3 [armor bonus] +3 [dex] @@[[@@Touch: -armor; Flat-footed: -dex@@]]@@||
||~ **Touch AC**||13[[/cell]][[cell style="width:50px;"]] ~ **Flat-footed AC**||14||
[[/cell]][[/row]][[/table]]

which begets
Experience 6765 xp
Total Hit Points
Current
31
31
AC 17 10 +3 [armor bonus] +3 [dex] [[Touch: -armor; Flat-footed: -dex]]
Touch AC 13 ~ Flat-footed AC 14

This is a little better for width, but it's too narrow, putting the height off; and it isn't resolving the cell as a "header" cell at all…

Is there something easy that I'm missing? Any help would be appreciated!

unfold Specifying Cell Width for a Header Cell? by Kitsune-DASKitsune-DAS, 1255249864|%e %b %Y, %H:%M %Z|agohover
Re: Specifying Cell Width for a Header Cell?
Kitsune-DASKitsune-DAS 1255250201|%e %b %Y, %H:%M %Z|agohover

So it's late enough at night that I'm hardly paying attention; I changed the "width:50px" in the second set of coding to "width:130px" and that solved my width issue, but it still isn't resolving as a header cell…

unfold Re: Specifying Cell Width for a Header Cell? by Kitsune-DASKitsune-DAS, 1255250201|%e %b %Y, %H:%M %Z|agohover
Why not use background color ?
Helmuti_pdorfHelmuti_pdorf 1255250602|%e %b %Y, %H:%M %Z|agohover
Experience 6765 xp
Total Hit Points
Current
31
31
AC 17 10 +3 [armor bonus] +3 [dex] [[Touch: -armor; Flat-footed: -dex]]
Touch AC 13 Flat-footed AC 14
[[table style="align:left"]] [[row]] [[cell]]
||~ **Experience**|||||| 6765 xp||
||~ **Total Hit Points** _
**Current**||||||31 _
31||
||~ **AC**|| 17||||10 +3 [armor bonus] +3 [dex] @@[[@@Touch: -armor; Flat-footed: -dex@@]]@@||
||~ **Touch AC**||13[[/cell]][[cell style="width:50px;background: #eee;"]]**Flat-footed AC**||14||
[[/cell]][[/row]][[/table]]

Service is my success. My webtips:www.blender.org, www.zusi.de (Demo-Video)

Wollen Sie Wikidot helfen im deutschen » Handbuch ?

last edited on 1255250962|%e %b %Y, %H:%M %Z|agohover by Helmuti_pdorf + show more
unfold Why not use background color ? by Helmuti_pdorfHelmuti_pdorf, 1255250602|%e %b %Y, %H:%M %Z|agohover
Re: Why not use background color ?
Kitsune-DASKitsune-DAS 1255288618|%e %b %Y, %H:%M %Z|agohover

That could work as a temporary solution! I'm just a little wary about using color-scheme-specific coding in my tables, as I already have my table colors set up in my site-wide CSS scheme. If I change my site's color scheme, I'll have to hunt through all my pages and recode color codes in my tables individually; if I get the heading code to work, it would color-change itself. I'd also like to be able to copy-paste my table codes between wikis without having to recode every color tag individually. This is the problem I'm having, even if it is a little OCD of me. ^_^;

unfold Re: Why not use background color ? by Kitsune-DASKitsune-DAS, 1255288618|%e %b %Y, %H:%M %Z|agohover
Ed JohnsonEd Johnson 1255278018|%e %b %Y, %H:%M %Z|agohover

It's interesting that you're mixing "simple and "complex" table syntax together. If you converted everything to the complex syntax, you would have much more control over the formatting of your table.

-Ed

unfold by Ed JohnsonEd Johnson, 1255278018|%e %b %Y, %H:%M %Z|agohover
Re:
Kitsune-DASKitsune-DAS 1255287994|%e %b %Y, %H:%M %Z|agohover

To be honest, I really like the simple syntax and overall it works very well for my purposes: I only really have experience with simple HTML and am learning Wikidot's syntax as I go. But if I were to use complex for this table (or at least this row/cell), what would be the code to use to reference the default "header" cell setting I already have set for my tables? Or, is there a page somewhere that I'm missing that gives a more complete listing of what can be done with tables/an outside website for the same sort of thing that you might recommend? Any help would be appreciated. :)

unfold Re: by Kitsune-DASKitsune-DAS, 1255287994|%e %b %Y, %H:%M %Z|agohover
Re:
Kitsune-DASKitsune-DAS 1255307853|%e %b %Y, %H:%M %Z|agohover

Also… I went back and looked at my site's custom CSS (which I essentially ripped apart and put back together from a few default pages: CSS here).

Apparently my problem is the same problem someone specified above: there is no <th> tag equivalent.

Has that been changed yet, or is it planned to be changed?

unfold Re: by Kitsune-DASKitsune-DAS, 1255307853|%e %b %Y, %H:%M %Z|agohover
Ed JohnsonEd Johnson 1255315459|%e %b %Y, %H:%M %Z|agohover

But if I were to use complex for this table (or at least this row/cell), what would be the code to use to reference the default "header" cell setting I already have set for my tables?

You could add some classes to your custom CSS that matches what you have already laid out for the simple tables (.wiki-content-table). Then, you just apply the custom class to complex tables so the styles are applied:

/* My Table Class */
.my-table { 
    color: #fcd7f4; 
    border-collapse: collapse; 
    border-spacing: 0; 
    border-color: #cd568c; 
    border-style: double; 
    margin: 0.5em auto; 
    background-color: #7f5a80; 
} 
.my-th {
    border: 1px solid #cd568c; 
    padding: 0.3em 0.7em; 
    background-color: #ffcbe7;
    color: #370f3d;
}
.my-td {
    border: 1px solid #cd568c; 
    padding: 0.3em 0.7em; 
}

Then you use it like this on your pages (note that you can combine style and class):
[[table class="my-table" style="float:right; width: 250px;"]]
[[row]]
[[cell class="my-th"]]
Sample Header Cell 1
[[/cell]]
[[cell class="my-td"]]
sample normal content 1
[[/cell]]
[[/row]]
[[row]]
[[cell class="my-th"]]
Sample Header Cell 2
[[/cell]]
[[cell class="my-td"]]
sample normal content 2
[[/cell]]
[[/row]]
[[/table]]
Sample Header Cell 1 sample normal content 1
Sample Header Cell 2 sample normal content 2

This solution would allow you to edit your colors and other styles in just one place (your custom CSS), so your concern about having to to do a bunch of manual edits to your tables flies out the window if you decide to make a change.

there is no <th> tag equivalent.

No there isn't, but this works around that. There is also no support for colspan. My alter-ego wrote a snippet that shows one way around that:
Mimic Colspan With Multiple Tables

I hope this helps! Let us know if you need more clarification.

-Ed

last edited on 1255315850|%e %b %Y, %H:%M %Z|agohover by Ed Johnson + show more
unfold by Ed JohnsonEd Johnson, 1255315459|%e %b %Y, %H:%M %Z|agohover
Re:
Kitsune-DASKitsune-DAS 1255316486|%e %b %Y, %H:%M %Z|agohover

The cell class solution works absolutely perfectly! Thank you so much! I really appreciate both the help and the patience. ^^

unfold Re: by Kitsune-DASKitsune-DAS, 1255316486|%e %b %Y, %H:%M %Z|agohover
Ed JohnsonEd Johnson 1255317980|%e %b %Y, %H:%M %Z|agohover

No problem. Sorry I couldn't reply sooner - the grandkids had me running around all day. Exhausting!

unfold by Ed JohnsonEd Johnson, 1255317980|%e %b %Y, %H:%M %Z|agohover
Add a new comment
Page tags: cell col layout row table
page_revision: 1, last_edited: 1217320520|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License