Page 1 of 1

BBCode table

PostPosted: Monday, 18th February 2013, 20:51
by jejorda2
Is there a BBCode tag or some other way to present tabular data in the forums?

I found bbcode syntax references that referred to table and tbl tags, but neither seem to work. I've been making the table in a spreadsheet. taking a screen capture of the spreadsheet, and uploading the capture as an image file attachment.

This looks okay, but it's difficult to edit and copy data from.

One of the suggested syntaxes was:
[tbl][tr][td]Some Info Here[/td][/tr][/tbl]
Is it easy to add this to the forum? Are there good reasons not to?

Is there an alternative I'm missing? I guess code tags preserve whitespace, so I could do it that way.

Re: BBCode table

PostPosted: Monday, 18th February 2013, 21:51
by njvack
Hm, I don't know for sure -- maybe there's a phpbb mod? Or an option? For now, I'd link to a Google spreadsheet.

Re: BBCode table

PostPosted: Monday, 18th February 2013, 22:00
by njvack
Ah, it looks like I can do this. I can't think of a good reason not to (as long as it doesn't open up a cross-site scripting hole)... I'd probably not abbreviate [tbl] because seriously you can type [table] it's ok. If people use tables for evil, we can tell them to stop.

For the moment code tags will also kind of work.

Re: BBCode table

PostPosted: Monday, 18th February 2013, 22:10
by jejorda2
[table]
[tr]
[th]Number[/th]
[th]Name[/th]
[/tr]
[tr]
[td]1[/td]
[td]One[/td]
[/tr]
[tr]
[td]2[/td]
[td]Bumblebee[/td]
[/tr]
[/table]

Re: BBCode table

PostPosted: Monday, 18th February 2013, 23:05
by Grimm
We can make custom tags in the Admin Control Panel. Spoiler tags are custom. I'll get on it later tonight.

Re: BBCode table

PostPosted: Tuesday, 19th February 2013, 02:26
by njvack
OK:
  Code:
[table][tr][th]Header1[/th][th]Header2[/th][/tr]
[tr][td]Data1[/td][td]Data2[/td][/tr][/table]

yields:

Header1Header2
Data1Data2


Some CSS is warranted to make this look a little nicer, but markup works.

Re: BBCode table

PostPosted: Tuesday, 19th February 2013, 02:38
by njvack
The CSS is a little nicer too, and woo. GRIMM GOT NINJA'D :)

The inline styles make the Baby Jesus cry. At some point in the near-ish future, I'll try and get ssh access and update the board software and also put this in a proper stylesheet.