Advertisement:

Navigation

SMF Mod Site

Mod Name:
Tabular
Created By:
AzaToth
Type:
BBC
First Created:
October 07, 2005, 12:28:36 PM
Last Modified:
March 18, 2007, 12:55:56 PM
Latest Version:
0.2.1
Compatible With:
1.1 RC1, 1.1 RC2, 1.1 RC3, 1.1, 1.1.2
Total Downloads:
34630

Download this mod

Tabular-0.1.4.tar.gz (2kB) [2010]
Tabular-0.1.5.tar.gz (2kB) [774]
Tabular-0.1.6.tar.gz (2kB) [708]
Tabular-0.2.0.tar.gz (2kB) [728]
Tabular-0.2.1.tar.gz (2kB) [30563]
Manual Install Instructions for SMF

Description:

Tabular

Tabular is a enhanced table, it's not a replacement, but more like an addition to it.
It's at the moment nine types of styles you can use, see below for how they look like.

Styles are defined for both default theme and classic theme, without the styles it will look just like a normal table.

Version 0.1.4 is only for 1.1 RC1, version 0.1.5 is only for 1.1 RC2, 0.1.6 is only for 1.1 RC3 and 0.2.0 is only for 1.1. 0.2.1 is a fix release for 1.1.2

Syntax

To start a tabular type

Code: [Select]
[tabular]
...
[/tabular]

there are two optional arguments:
  • type - a number from 1 to 9 (nine different types at the moment)
  • caption - a quote enclosed bbc string as caption
a row is defined as:
Code: [Select]
[row] ... [/row]
You can have table header:
Code: [Select]
[head] ... [/head]
And table data is typed as:
Code: [Select]
[data] ... [/data]
The reason I use data, head and row instead of tr, td and th is mostly becfause SMF have in Subs-Post.php a check that will destroy the tabular code if those is used.

A full example is:

Code: [Select]
[tabular type=4 caption="[b]Table 1:[/b] My budget this month (in dollars)"]
[row] [head]Type[/head] [head]In[/head] [head]Out[/head] [head]Sum[/head] [/row]
[row] [data]Payment[/data] [data]4000[/data] [data]0[/data] [data]4000[/data] [/row]
[row] [data]Food[/data] [data]0[/data] [data]3000[/data] [data]1000[/data] [/row]
[row] [data][red]Mama[/red][/data] [data]10000[/data] [data]0[/data] [data]11000[/data] [/row]
[row] [data]Computer[/data] [data]0[/data] [data]10500[/data] [data]500[/data] [/row]
[row] [data]Jolt[/data] [data]0[/data] [data]500[/data] [data]0[/data] [/row]
[/tabular]

you can also use colspan and rowspan on data and head if you want to

Code: [Select]
[data colspan=2] foo [/data]
Examples
The types 6 to 9 have transparent background.
This is from default theme, classic have different colors.
  • Type 1
  • Type 2
  • Type 3
  • Type 4
  • Type 5
  • Type 6
  • Type 7
  • Type 8
  • Type 9
  • Example with caption

Bugs

I have been unable to use require_children and require_parents in the code, so if you type [row], [head] and [data] at the wrong place it can look ugly