Table Attributes

Posted by stacita on 02 Aug 2009 15:12, last edited by Ed Johnson on 06 Jul 2017 11:21

: table

rating: +11
This page is a stub. You can help us improve Wikidot by .

Table Style Attributes

Customise advanced tables using inline CSS.

attribute similar attributes required allowed values default description
background-color N/A no Any colour (e.g. name blue or HEX #F0F0F0) transparent Used to define the background color of a table, row or cell
border border-top
border-right
border-bottom
border-left no Three space-separated values
(e.g. 1px solid black) none Used to define the border style of a table, row or cell
margin margin-top
margin-right
margin-bottom
margin-left no auto
px, em, % auto Used to define the amount of space between the table and outside content
padding padding-top
padding-right
padding-bottom
padding-left no px, em, % 0px Used to define the amount of space between the table and inside content
width N/A no px, em, % matches content Used to define the width of a table, row or cell
vertical-align N/A no top
bottom center Most commonly used to make text remain at the top of a cell that is bigger than the content needs it to be (adjacent cells in the same row can cause this to happen)
Float N/A no right
? ? Floats a table "on top" of the page so to speak, it is useful for relocating a table to the top right and not losing lines. It can end up covering other items. Floating a second item to the right places it to left of the first one, not below it.

border attribute

Three space-separated values are used to define the border's style.

Example:

[[table style="border: 1px solid black;"]]
 [!-- TABLE CONTENTS --]
[[/table]]

1. First value defines the border's width:

  • Two formats supported: px, em
  • e.g. 3px or 1.5em

2. Second value is style

  • Several styles are available:
    • none
    • hidden
    • dotted
    • dashed
    • solid
    • double
    • groove
    • ridge
    • inset
    • outset
    • inherit

3. Third value is color

  • Two formats supported: color name, or a HEX value
  • e.g. blue or #F0F0F0

Syntax

  • Attributes must be enclosed within the quotes of the style="" parameter.
  • Separate each attribute with a semi-colon.

Table syntax is shown below. Each style parameter is optional.

[[table style="attribute1; attribute2; attribute3 ..."]]
[[row style="attribute1; attribute2; attribute3 ..."]]
[[cell style="attribute1; attribute2; attribute3 ..."]]
Content goes into cells
Attempting to insert text into a table or row directly will cause errors
[[/cell]]
[[/row]]
[[/table]]

Example:

Layout with Tables

Related


Please edit and develop me!

Related articles

Comments

[table] attributes
gerdami gerdami 03 Aug 2009 14:35

I would not write an article on [table] attributes and use |piped| tables in the text…

Last edited on 03 Aug 2009 14:36 by gerdami
by gerdami gerdami , 03 Aug 2009 14:35
Re: [table] attributes
leiger leiger 03 Aug 2009 14:38

You have a good point there! =)

However, the doc:wiki-syntax page has simple tables used regularly to list attributes… shouldn't it be the same here? =/

I like consistency =)


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

Last edited on 03 Aug 2009 14:41 by leiger
by leiger leiger , 03 Aug 2009 14:38
Re: [table] attributes
gerdami gerdami 03 Aug 2009 15:01

I do not agree:

  1. This is not about wikidot syntax but inline CSS style.
  2. Community HowTos do not have to be consistent with main doc but give pragmatic examples.
by gerdami gerdami , 03 Aug 2009 15:01
Re: [table] attributes where are they?
Helmut_pdorf Helmut_pdorf 03 Aug 2009 15:16

I have changed ( inserted ) a complex table with the same content ( I believe)
with the followng code:

Since this moment I see NOTHING rendered on the page.

EDIT: It was a copied comment with non ending comment ocde… Sorry,

PLEASE - HAVE A LOOK!

And if OK - delete the old table…


Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.

Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?

Last edited on 03 Aug 2009 15:37 by Helmut_pdorf
by Helmut_pdorf Helmut_pdorf , 03 Aug 2009 15:16
Re: [table] attributes where are they?
Brunhilda Brunhilda 03 Aug 2009 16:05

It is better now! I deleted the old table…


If slaughterhouses had glass walls, everyone would be vegan. - Paul McCartney

by Brunhilda Brunhilda , 03 Aug 2009 16:05
Re: [table] attributes where are they?
leiger leiger 04 Aug 2009 10:35

Looks good gerdami!! =)


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 04 Aug 2009 10:35
Re: [table] attributes where are they?
gerdami gerdami 04 Aug 2009 12:43

I miss the vertical-align …


I think that it would be a good opportunity here to explain how to create class styles that can be repeated throughout the [cell]s, thus avoiding unreadable/unmanageable code source.

by gerdami gerdami , 04 Aug 2009 12:43
Re: [table] attributes where are they?
leiger leiger 04 Aug 2009 13:18

Vertical align works…

[[table style="vertical-align: top;"]] will make sure text stays at the top of the cell instead of floating in the centre.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 04 Aug 2009 13:18
Tables with absolute width values?
etnolinguistica etnolinguistica 09 Mar 2012 17:42

Hello! I would like to create a table with two columns (65% and 35% width), but have them to always display the same width whether there's content or not. here it is said that the width will, by default, adjust to content. How do I change the default?

Thanks for any tips!



Etnolinguistica.Org
An information hub on South American languages

by etnolinguistica etnolinguistica , 09 Mar 2012 17:42
Re: Tables with absolute width values?
Helmut_pdorf Helmut_pdorf 09 Mar 2012 18:07

If you use ABSOLUT width:600px for the table as in the examples below, than the width 65% and35% are always ident:


[[table style="color: #fcd7f4; border-collapse: collapse; border-spacing: 0; border-color: #cd568c; border-style: double; margin: 0.5em auto; background-color: #7f5a80; width: 600px;"]]
[[row]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em; background-color: #ffcbe7; color: #370f3d; width: 65%;"]]
[[/cell]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em;width: 35%;"]]
[[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em; background-color: #ffcbe7; color: #370f3d;width: 65%;"]]
[[/cell]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em;width: 65%;"]]
[[/cell]]
[[/row]]
[[/table]]

content cell1 content cell2
content cell3

[[table style="color: #fcd7f4; border-collapse: collapse; border-spacing: 0; border-color: #cd568c; border-style: double; margin: 0.5em auto; background-color: #7f5a80; width: 600px;"]]
[[row]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em; background-color: #ffcbe7; color: #370f3d; width: 65%;"]]
content cell1 
[[/cell]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em;width: 35%;"]]
content cell2 [[/cell]]
[[/row]]
[[row]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em; background-color: #ffcbe7; color: #370f3d;width: 65%;"]]
content cell3
[[/cell]]
[[cell style="border: 1px solid #cd568c; padding: 0.3em 0.7em;width: 65%;"]]
[[/cell]]
[[/row]]
[[/table]]

Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.

Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?

Last edited on 09 Mar 2012 18:08 by Helmut_pdorf
by Helmut_pdorf Helmut_pdorf , 09 Mar 2012 18:07
Re: Tables with absolute width values?
etnolinguistica etnolinguistica 09 Mar 2012 18:25

Thanks, Helmuti! That helped a lot!



Etnolinguistica.Org
An information hub on South American languages

by etnolinguistica etnolinguistica , 09 Mar 2012 18:25
Re: Tables with absolute width values?
Naomi Wiflath Naomi Wiflath 03 Jul 2017 04:32

I'm going to jump on this thread because I am running into a similar issue. I want text to stay within the box if there is LOTS of it, and to automatically make a new line, instead of extending my table into the void.

I'm trying to make my own gallery include since we still don't have full light box support yet.

[[table align="center"]]
[[row]]
[[cell style="padding: 5px; background-color: #444444; border: 0px solid silver; width: 200px;"]]
[[=image {$image} link="{$link}" width="{$width}"]]
[[/cell]]
[[cell style="padding: 5px; background-color: #444444; width: 1000px; border: 0px solid silver"]]
[[=]]
##0099FF|**{$title}**##
##0099FF|**Date Submitted/Completed: {$date}**##
[[/=]]
##0099FF|Comments:## ##DDDDDD|{$comments}##
[[/cell]]
[[/row]]
[[/table]]

Omnia mutantur, nihil interit.

by Naomi Wiflath Naomi Wiflath , 03 Jul 2017 04:32
(account deleted) 03 Jul 2017 19:09

Do you have a live example you can share?

You should be able to fix this with some CSS. This thread on Stack Overflow might help:
https://stackoverflow.com/questions/6666532/how-to-force-table-cell-td-content-to-wrap

by (account deleted), 03 Jul 2017 19:09
(account deleted) 03 Jul 2017 19:20
[[table align="center" style="table-layout:fixed; width:650px;"]]
[[row]]
[[cell style="padding: 5px; background-color: #444444; border: 0px solid silver; width: 150px;"]]
image placeholder
[[/cell]]
[[cell style="padding: 5px; background-color: #444444; width: 400px; border: 0px solid silver; word-wrap:break-word; white-space: pre-wrap;"]]
[[=]]
##0099FF|**Title Text**##
##0099FF|**Date Submitted/Completed: {$date}**##
[[/=]]
##0099FF|Comments:## ##DDDDDD|Cupcake ipsum dolor sit amet ice cream. Gummi bears I love jelly beans marshmallow soufflé. Bonbon dragée I love I love cotton candy marshmallow chocolate cake brownie toffee.
Fruitcake I love pudding sesame snaps cake dessert jujubes apple pie toffee. Pastry tart pastry pudding cookie. Chupa chups cake cupcake fruitcake carrot cake gingerbread marshmallow.
Caramels sesame snaps jelly beans candy I love I love. I love sugar plum cake tootsie roll I love cake. Pudding icing macaroon cookie brownie pastry carrot cake. Jelly-o candy canes cake tootsie roll chocolate bar.
Cheesecake lollipop pastry. Croissant cake marzipan I love. I love cake candy tart topping brownie.
Powder marzipan halvah cookie marzipan. Muffin brownie apple pie cake bear claw. Donut jujubes chocolate cake.##
[[/cell]]
[[/row]]
[[/table]]

Quick Example

image placeholder

Title Text
Date Submitted/Completed: {$date}


Comments: Cupcake ipsum dolor sit amet ice cream. Gummi bears I love jelly beans marshmallow soufflé. Bonbon dragée I love I love cotton candy marshmallow chocolate cake brownie toffee.
Fruitcake I love pudding sesame snaps cake dessert jujubes apple pie toffee. Pastry tart pastry pudding cookie. Chupa chups cake cupcake fruitcake carrot cake gingerbread marshmallow.
Caramels sesame snaps jelly beans candy I love I love. I love sugar plum cake tootsie roll I love cake. Pudding icing macaroon cookie brownie pastry carrot cake. Jelly-o candy canes cake tootsie roll chocolate bar.
Cheesecake lollipop pastry. Croissant cake marzipan I love. I love cake candy tart topping brownie.
Powder marzipan halvah cookie marzipan. Muffin brownie apple pie cake bear claw. Donut jujubes chocolate cake.
by (account deleted), 03 Jul 2017 19:20
Naomi Wiflath Naomi Wiflath 04 Jul 2017 04:13

Wow you conquered this before I even got home from work. Ahhh. So the key is in the word-wrap modifier? I didnt even know that was a thing, let alone a thing wikidot supported. Is there a page that talks about that on wikidot? Its taken me some tinkering and fiddling to understand the code chunk but I understand it now, and i appreciate the help! :D


Omnia mutantur, nihil interit.

by Naomi Wiflath Naomi Wiflath , 04 Jul 2017 04:13
(account deleted) 05 Jul 2017 12:13
css-is-awesome-mug.jpg

This is really a CSS thing, not a Wikidot thing. In addition to supporting CSS at the theme level, Wikidot supports inline CSS in most elements ([[div]], [[span]], [[image]], [[table]], etc.) as we're used here. A great place to learn about and reference CSS is W3Schools. And remember, Google is your friend! ;-)

A funny coincidence… Right after posting the sample code, this popped up on my Facebook feed: CSS is Awesome

The mug is poking fun at how maddening CSS can be when trying to do what seems to be something simple and obvious.

It's refreshing to help with a real question instead of wading through the cesspool of spam around here these days. I like spending time engaging in helpful conversation rather than wasting it stomping on spammers.

Last edited on 05 Jul 2017 12:49 by (account deleted)
by (account deleted), 05 Jul 2017 12:13
Timothy Foster Timothy Foster 06 Jul 2017 00:53

That's one sassy mug.


Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me

by Timothy Foster Timothy Foster , 06 Jul 2017 00:53
(account deleted) 06 Jul 2017 11:13
fb-haha.jpg
by (account deleted), 06 Jul 2017 11:13
Column and Row spanning cells
nerdvana nerdvana 04 Aug 2017 09:56

How are column and row spanning cells done? I've tried putting in colspan and rowspan in the style and that doesn't seem to work. Anyone know if this is possible?

by nerdvana nerdvana , 04 Aug 2017 09:56
Re: Column and Row spanning cells
nerdvana nerdvana 04 Aug 2017 10:12

I found my own answer here

by nerdvana nerdvana , 04 Aug 2017 10:12
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.
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.
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.

AltStyle によって変換されたページ (->オリジナル) /