Loading...
 
Features / Usability

Features / Usability


Tables - |

posts: 35 United States

I have generated several tables using the double-bar syntax — | | --

Is there a method that uses things like 'width=40%' or 'cellpadding=10' on a normal table?


1) I'd like to get some extra space around the text, so the lines aren't so close to the tables.

E.g.:

http://tbchampaign.com/tiki-index.php?page=TableTest



2) I'd like to be ale to specify a width for the table, so each column would expand to take up 1/4th of the wide, or whatever.


3) Is there any way to specify that items should be centered within the table cells?



Thanks in advance for any help!

Norm

posts: 4656 Japan

> I have generated several tables using the double-bar syntax — | | --
>
> Is there a method that uses things like 'width=40%' or 'cellpadding=10' on a normal table?

Not using that syntax, I think, as it's pretty basic.

> 1) I'd like to get some extra space around the text, so the lines aren't so close to the tables.

> 2) I'd like to be ale to specify a width for the table, so each column would expand to take up 1/4th of the wide, or whatever.

Tables made with the wiki syntax have the class "wikitable" so they can be styled by editing the CSS file for the theme. But of course this will affect all such tables within wiki pages. If that's OK, then edit the style sheet. If not, a new plugin is probably needed, maybe a variant of the FANCYTABLE plugin that adds a width property, and can be used just for specific table instances.

Maybe you could also experiment with the SPLIT plugin, as it creates a table (class="normal") whose columns can be assigned widths.

> 3) Is there any way to specify that items should be centered within the table cells?

The normal wiki syntax for centering (::this is centered::) will work in table cells.

-- Gary

posts: 3665 United States

>
> > 1) I'd like to get some extra space around the text, so the lines aren't so close to the tables.
>
> > 2) I'd like to be ale to specify a width for the table, so each column would expand to take up 1/4th of the wide, or whatever.
>
> Tables made with the wiki syntax have the class "wikitable" so they can be styled by editing the CSS file for the theme. But of course this will affect all such tables within wiki pages. If that's OK, then edit the style sheet. If not, a new plugin is probably needed, maybe a variant of the FANCYTABLE plugin that adds a width property, and can be used just for specific table instances.
>


Or, you could ecapsulate the entire table in a custom DIV, then just add a single new style to your CSS:

Copy to clipboard
{DIV(class="mytable")} ||r1c1|r1c2 r2c1|r2c2|| {DIV}


Then, in your CSS add someting like:

Copy to clipboard
div#mytable table { ... }


-Rick

Note: This is untested, just an idea.....
posts: 4656 Japan

> > ...
>
> Or, you could ecapsulate the entire table in a custom DIV, then just add a single new style to your CSS:
>
> ...
>

>
Note: This is untested, just an idea.....


That should work. div.mytable can have a width:40% property and div.mytable table a width:100% property. div.mytable table td can also have a padding:10px property and whatever else is needed.

-- Gary


posts: 35 United States

Re: putting a table within a div.

Sounds like an ideal solution!

Can someone tell me how to edit the CSS? I did a quick scan for it in the directory and didn't see any obvious method.

I tried going to mysite/tiki-edit_css.php and got the message feature not enabled. Go home.

I looked over the wiki and general admin pages and didn't see anything; did a search for css, nothing.


posts: 80 Austria

Hallo!

I modified the Fancytable plugin to enter tablesize and culomn size in the plugin definition.
I'll post the modification if you want.

Torpedro

posts: 1817 Catalan Countries

> Hallo!
>
> I modified the Fancytable plugin to enter tablesize and culomn size in the plugin definition.
> I'll post the modification if you want.
>
> Torpedro

Yes, please, do it in cvs! Thanks, Torpedro :-)


posts: 35 United States

Just tried it .. it doesn't change the size of the "table".

This is box 1Column 2Column 3
Row 2, column 1
2
3


{ D IV ( width=80% ) } | | This is box 1|Column 2|Column 3
Row 2, column 1|: :2: :|3 | | { DI V }

Is there some attribute other than width that I need to change?

If I align it right, it takes up the whole 80% of the space .. obviously the DIV is taking up the 80%, but when the table builds it doesn't take up any extra space. The below table takes up 50% of the space on the right.

This is box 1Column 2Column 3
Row 2, column 1
2
3




BUT .. I changed my tables to fancytables .. didn't realize that feature is there. How many other features aren't well documented and new users can't find them??

posts: 3665 United States

>
> Is there some attribute other than width that I need to change?
>

You have to assign the class name — not the width:

Copy to clipboard
{DIV(class="mytable")}..... {DIV}


The width is controlled in the CSS style — not the wiki DIV code.

>
>
>
> BUT .. I changed my tables to fancytables .. didn't realize that feature is there. How many other features aren't well documented and new users can't find them??

They're all (most, anyway) listed in the docs.

HTH,

-Rick

posts: 35 United States

> > BUT .. I changed my tables to fancytables .. didn't realize that feature is there. How many other features aren't well documented and new users can't find them??
>
> They're all (most, anyway) listed in the docs.
>
> HTH,
>
> -Rick

Thanks .. wouldn't it make sense to document fancytable where the simple tables are documented, since most likely someone trying to use a simple table would want to at least know that fancytable's are available?

This is my primary complaint about most documentation — sure, it goes through a page and goes step by step to show you how to use each featue on the page, but when I'm trying to get a specific look, in this case something that fancytable met perfectly, and I'm looking through the docs available on the page (wikihelp at the bottom of the text editor) I'm shown one feature that doesn't meet my needs but not given a hint that another feature exists that's almost perfectly built for my needs.