PDA

View Full Version : BBCode Equivalent for <Table>


Michael Morris
07-31-2004, 08:46 AM
Hello everyone. I'm trying to figure out how to write a hack that allows users to construct tables. My board is one games - d20 and D&D in particular - and the users often need to display tables of varying sizes.

To date they've been told to use the code tag to and space the things out, but this a bit time consuming and frankly doesn't look nice.

I've been thinking such a tag would be similar to the {list} tag in function except that vbulletin would have to count how many items it's been given. For instance

{Table=3} would start up a table with three columsn
{*} First item, would show on row one, colum one
{*} Second item, would show on row one, colum two
{*} Third item, would show on row three, colum three
{*} Fourth item, would show on row one colum one
{/table}
If the user forgot to put in a fifth and 6th item vbulletin would put however many <td>space</td> entries that would be necessary.

Anyway, I'm gonna work on this, but I could use help if anyone has any ideals on how to do this.

weitalia
09-22-2004, 02:35 PM
I found it FANTASTIC as idea,and i'm really interested in it.
But i think it'd be so much complicated,and i don't know how to do,especially to capture all those parameters [?!?!?]....

;)

Symbian.info
09-23-2004, 10:27 AM
i'm also really interested in it!

weitalia
10-12-2004, 10:14 AM
So,at the end I did it ;)
You have to add those 3 BB Codes ;)

1st CODE

Add New BB Code
Title : Grid
Tag : grid
Replacement : <table {option} summary="">{param}</table>
Example : Table content
Description : Make a Table
Use {option} : YES
2nd CODE

Add New BB Code
Title : Row
Tag : row
Replacement : <tr>{param}</tr>
Example : Row cells
Description : Add Row
Use {option} : NO
3rd CODE

Add New BB Code
Title : Cell
Tag : cell
Replacement : <td {option}>{param}</td>
Example : Cell 1
Description : Add Cell
Use {option} : YES
That's everything!! Here's an example of how use it :
Cella 1 Cella 2 Cella 3 Cella 4 Cella 5 Cella 6 Cella 7 Cella 8 Cella 9 Cella 10 Cella 11 Cella 12
Have fun!!! ;)

;)