Better Tables in SMF forums

Started by Den, 2017-Oct-27 08:10

Previous topic - Next topic

Den

Need for simple ways to create tables in SMF forums.

1. Extend table code to allow various types of formats.
Ex.
tables=vsv

2. Common types of formats: VSV, csv, wiki, markdown, reStructuredText
Support me on Patreon

I saw. I conquered. I came.

Den

#1
Alternative ways to create tables. These use the "tables" tag, instead of the default "table" (note the extra "s" for our new method.)



VSV (Versatile Separated Values) is my own creation and proposal for a simple way to create lists and tables in any plaintext file, yet easily converted into HTML code for websites (via dedicated plugins for specific forum or content frameworks; e.g. SMF forums and WordPress blogs).

Traditionally only commas, tabs, and spaces were allowed to be delimiters. However, in VSV, any character except space can be used as delimiters. The delimiter of each line is the first nonspace character at the beginning of that line. (Learn more about VSV)

[tables=vsv]
((``Demo Caption``r))
[[Name]] {{Age}} ((Gender))
,Hammie, 20.5, F
-Chow, Vivian-40-F
:Amuseum:25:M:
*Shena'Fu *18+5/12 *F
|Grndr-1245|21 months||
Fairy Nuff 14 K N/A
((``Guess who they are :)``b))
[/tables]

Demo CaptionGuess who they are :)
NameAgeGender
Hammie 20.5 F
Chow, Vivian40F
Amuseum25M
Shena'Fu 18+5/12 F
Grndr-124521 months
Fairy Nuff14 KN/A


Comma separated values
[tables=csv]
Name, Score 1, Score 2
BEAKL 9, 120, 144
BEAKL 10, 44, 99
[/tables]

NameScore 1Score 2
BEAKL 9 120 144
BEAKL 10 44 99


VSV (compare to CSV above)
[tables=vsv]
((``BEAKL Scores``l))
((Name)) ((Score 1)) ((Score 2))
,BEAKL 9, 120, 144
,BEAKL 10, 44, 99
[/tables]

BEAKL Scores
NameScore 1Score 2
BEAKL 9 120 144
BEAKL 10 44 99


Markdown #1
[tables=md]
Name     Score 1 Score 2
-------- ------- -------
BEAKL 9  120     144
BEAKL 10 44      99
-------- ------- -------
[/tables]

Name     Score 1 Score 2
BEAKL 9  120     144
BEAKL 10 44      99


Markdown #2
[tables=md]
+----------+---------+---------+
| Name     | Score 1 | Score 2 |
+----------+---------+---------+
| BEAKL 9  | 120     | 144     |
| BEAKL 10 | 44      | 99      |
+----------+---------+---------+
[/tables]

Name     Score 1 Score 2
BEAKL 9  120     144    
BEAKL 10 44      99     


reStructuredText #1
[tables=rst]
======== ======= =======
Name    Score 1 Score 2
======== ======= =======
BEAKL 9  120    144
BEAKL 10 44      99
======== ======= =======
[/tables]

Name     Score 1 Score 2
BEAKL 9  120     144
BEAKL 10 44      99


reStructuredText #2
[tables=rst]
+----------+---------+---------+
| Name     | Score 1 | Score 2 |
+==========+=========+=========+
| BEAKL 9  | 120     | 144     |
| BEAKL 10 | 44      | 99      |
+----------+---------+---------+
[/tables]

Name     Score 1 Score 2
BEAKL 9  120     144    
BEAKL 10 44      99     


wikiTables
[tables=wiki]
{|
!Name!!Score 1
!Score 2
|-
|BEAKL 9||120
|144
|-
|BEAKL 10
|44||99
|}
[/tables]

Name Score 1 Score 2
BEAKL 9 120 144
BEAKL 10 44 99



The following is the default method, using the "table" tag.
[table]
[tr]
[td]Name[/td]
[td]Score 1[/td]
[td]Score 2[/td]
[/tr]
[tr]
[td]BEAKL 9[/td]
[td]120[/td]
[td]144[/td]
[/tr]
[tr]
[td]BEAKL 10[/td]
[td]44[/td]
[td]99[/td]
[/tr]
[/table]

NameScore 1Score 2
BEAKL 9120144
BEAKL 104499

Support me on Patreon

I saw. I conquered. I came.

ADMIN

2022/03/16

Now VSV tables can have captions. Captions for a VSV table can be created in header fields when preceded by double ticks ``. A second double-ticks will signify the position of the caption. Use 'lcr' to align the caption left, center, or right, respectively. Use 'tb' to place the caption above or below the table, respectively. The default is 'ct'. A table may have more than one caption.

Ex.
((``Demo Caption``r)

will align the caption to the right.