View Single Post
Old July 13th, 2015, 04:40 PM   #2
MrInBetween
R.I.P.
 
MrInBetween's Avatar
 
Join Date: Jul 2012
Location: Gone But Not Forgotten
Posts: 3,934
Thanks: 51,364
Thanked 48,451 Times in 3,898 Posts
MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+MrInBetween 175000+
Default Further options explored

Quote:
Originally Posted by hos View Post
more?

the new function offers some more options (like sorting, connecting cells, table header and some more) which aren't described with this quick guide yet. if you want to self-exercise, visit this post:
http://www.vbulletin.org/forum/showp...70&postcount=2
Thought I'd try some of those things in that link, and post the results. I've used hos's first example table, adding an extra line to it:

column 1 column 2 column 3 column 4 column 5
cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
  cell 2 of row 3 cell 4 of row 3 
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4


Merging Cells

Table options, unlike BBCode, are always in lower case. There's one that differs from the others in that it's placed at the start of a cell: '{colsp=2}' (or whatever value) causes that many cells to merge together. The effect only applies on that row and all the following cells are moved up, in this case causing the last one to be lost:
Quote:
[TABLE] column 1 | column 2 | column 3 | column 4 | column 5
{colsp=2}cell 1 of row 2 | | cell 3 of row 2 | | cell 5 of row 2
| cell 2 of row 3 | | cell 4 of row 3
cell 1 of row 4 | | cell 3 of row 4 | | cell 5 of row 4[/TABLE]
column 1 column 2 column 3 column 4 column 5
cell 1 of row 2 cell 3 of row 2
  cell 2 of row 3 cell 4 of row 3 
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4


Column Headings

All the remaining options are added in the TABLE tag itself. The option 'head' gives the first line a distinctive look:
Quote:
[TABLE=head] column 1 | column 2 | column 3...
column 1 column 2 column 3 column 4 column 5
cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
  cell 2 of row 3 cell 4 of row 3 
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4


Specifying Table Width

Usually a table is the cumulative width of each column but it can be made to span the posting area by adding the option 'width=100%'. Additional options are added using a semicolon - looks peculiar because the first equals sign starts the list of options, the second one is part of an option:
Quote:
[TABLE=head;width=100%]
column 1 column 2 column 3 column 4 column 5
cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
  cell 2 of row 3 cell 4 of row 3 
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4

Smaller percentages can be used, but the table can never be made narrower than is necessary to hold all its contents:
Quote:
[TABLE=head;width=10%]
column 1 column 2 column 3 column 4 column 5
cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
  cell 2 of row 3 cell 4 of row 3 
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4

Comes out more like 33%. The width can also be expressed in pixels or em-spaces:
Quote:
[TABLE=head;width=500px]
Quote:
[TABLE=head;width=40em]
Although percentages greater than 100% won't make the table wider than the posting area, larger tables can be achieved by increasing the width of the posting area itself, for example with a long line of dashes.


Auto-numbering

The 'autonum=1' option inserts a column at the front of the table and automatically fills it with sequential numbers:
Quote:
[TABLE=head;autonum=1]
  column 1 column 2 column 3 column 4 column 5
1cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
2  cell 2 of row 3 cell 4 of row 3 
3cell 1 of row 4 cell 3 of row 4 cell 5 of row 4

The numbers go up to 500, which is the maximum number of rows possible. Lower-case letters can be used instead:
Quote:
[TABLE=head;autonum=a (or just autonum)]
Letters run from a-z, then aa-sf. Uppercase letters can also be specified:
Quote:
[TABLE=head;autonum=A]
The numbering begins on the second row because the 'head' option was used. The first cell of all is left blank, but the 'autonumtitle' option can specify a heading:
Quote:
[TABLE=head;autonum=1;autonumtitle=count]
count column 1 column 2 column 3 column 4 column 5
1cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
2  cell 2 of row 3 cell 4 of row 3 
3cell 1 of row 4 cell 3 of row 4 cell 5 of row 4


Sorting

The 'sort' option sorts the table by the specified column. The 'head' option once again prevents the first row being affected:
Quote:
[TABLE=head;sort=1]
column 1 column 2 column 3 column 4 column 5
  cell 2 of row 3 cell 4 of row 3 
cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4

The sort order can be reversed with the addition of 'd' for descending:
Quote:
[TABLE=head;sort=1d]
column 1 column 2 column 3 column 4 column 5
cell 1 of row 4 cell 3 of row 4 cell 5 of row 4
cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
  cell 2 of row 3 cell 4 of row 3 

If 'autonum' is also used, the sort ignores it, so column 1 is still column 1 and the auto-numbers are applied afterwards rather than being sorted:
Quote:
[TABLE=head;sort=1d;autonum=1]
  column 1 column 2 column 3 column 4 column 5
1cell 1 of row 4 cell 3 of row 4 cell 5 of row 4
2cell 1 of row 2 cell 3 of row 2 cell 5 of row 2
3  cell 2 of row 3 cell 4 of row 3 

Finally, secondary sort orders can be defined by specifying further column numbers, separated by commas:
Quote:
[TABLE=head;sort=1,4]
__________________

I'm sorry Gentlemen, that's all the lipstick around the nipple we have time for

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
MrInBetween is offline   Reply With Quote
The Following 24 Users Say Thank You to MrInBetween For This Useful Post: