PDA

View Full Version : New tables, converter



The-Mage-King
2014-03-31, 03:40 PM
So, a while back (meaning before the change in formatting), I asked a friend of mine who codes if he'd make a converted for me, so I could just c/p my old tables.


He made one and stuck it as a webpage (http://makaze-kanra.tumblr.com/ForumTableConverter). Then he asked me to share it with you guys, since he thinks it'll generally be helpful.

He stuck the source here (http://pastebin.com/WnqdwSKz), if anyone wants to look it over.


Quick note on use: Change the { in a broken tag back to a bracket, and the top row's formatting changes to from , and changes the header to be different from the text.


[table="class: grid head"]
[th]Bonus TypeRank
Weapon Use4
Defensive Mastery2
Heroic Resistance1
Paragon3
Skill Mastery2




[td]Bonus TypeRank
Weapon Use4
Defensive Mastery2
Heroic Resistance1
Paragon3
Skill Mastery2




Examples taken from one of my own homebrews.

nedz
2014-03-31, 04:14 PM
Thanks, this was very handy.:smallcool:

I'd have had to write one myself otherwise :smallsmile:

PairO'Dice Lost
2014-03-31, 04:49 PM
I did write one myself, but this is still handy. :smallwink: Thanks for sharing.

Seerow
2014-03-31, 05:29 PM
I've been using Word's Find and Replace function, but this is convenient.

Duck999
2014-03-31, 06:05 PM
Very handing seeming, but the convert button doesn't seem to do anything for me. I click it and nothing happens. Any idea what the problem is?

Seerow
2014-03-31, 06:07 PM
Can you copy/paste the thread you're trying to convert here? (put it into a spoiler block)

The-Mage-King
2014-03-31, 06:08 PM
Very handing seeming, but the convert button doesn't seem to do anything for me. I click it and nothing happens. Any idea what the problem is?

Might be javascript. Do you have it off?


Alternatively, is the table inserted the old style?

Like|this|?

Duck999
2014-03-31, 06:14 PM
It's the old style definately. It could be the javascript part. I'll try again when there is someone more computer smart at my house.

Seerow
2014-03-31, 06:18 PM
I just played around with the table converter some, and it seems pretty buggy.

Having just instead of seems to cause it to die. I'm guessing this is Duck's issue, his table just didn't have a head element, and the converter doesn't know what to do with that.

Having a newline after [table] but before any data goes in (which is something the old forums did support) results in the table head being empty and the intended header becoming the second row.

A table using colspan doesn't cause it to not work, but it also just sticks the colspan code into the td (while afaik there's no way to get a colspan to work in the current bbcode, the converter should at least remove it).

Also having extra new line characters causes it to add in extra blank rows, which will make tables look inexplicably ugly when people try to use it.


for example this:

(pretend like the table=head and /table commands are at the start and end of this snippet, the board doesn't like them even inside a code element for some reason)


this | is | a | test

this | is | a | test

this | is | a | test
this | is | a | test
this | is | a | test



turns into this:
[table]




this
is
a
test





this
is
a
test


this
is
a
test


this
is
a
test


this
is
a
test







Also looking at the output, the converter should make table="class:grid" the default, most people are going to want tables where you can actually see the borders.

The correct output should look like:
[table="class:grid"]

this
is
a
test


this
is
a
test


this
is
a
test


this
is
a
test


this
is
a
test

The-Mage-King
2014-03-31, 06:42 PM
Hm. Passed along to the guy who did it. I'll let you know what he says.

Might have to do with it being made for "this|is|a|test" instead of "this | is | a | test", though.

nedz
2014-03-31, 06:49 PM
Hi, very useful tool — but I have a small bug report.

It may just be my tables but it seems to add an extra 1 cell line at the end. Coloured Purple in this example.

Occasionally you also get some additional guff. Coloured Red in this example.




Description
Thread
Pages
Version


Shadows of the Last War
Yellow lock can only be opened by a yellow key which does not exist
4
11
3.5




[/td]
[/tr]



{table="class:grid"]


Description
Thread
Pages
Version


Shadows of the Last War
Yellow lock can only be opened by a yellow key which does not exist
4
11
3.5




[/table]

[tr]
[td]

Input String ([ changed to { obviously)

{table=head]|Description|Thread|Pages|Version
Shadows of the Last War|Yellow lock can only be opened by a yellow key which does not exist|4|11|3.5
[/table]

The-Mage-King
2014-03-31, 07:55 PM
This better?

[table="class:grid"]

this
is
a
test


this
is
a
test


this
is
a
test


this
is
a
test


this
is
a
test





[OTHER ISSUE]

Try now. Should work.

EDIT: In summation, those bugs are fixed.

Seerow
2014-03-31, 08:08 PM
Yeah that update seems to fix most of the issues.

Using just [table] instead of [table=head] works now (and doesn't use the [th] tags, which is good), but doesn't set the table class to grid.

The-Mage-King
2014-03-31, 09:31 PM
Yeah that update seems to fix most of the issues.

Using just [table] instead of [table=head] works now (and doesn't use the [th] tags, which is good), but doesn't set the table class to grid.

Alright, he says he fixed that one now, too.

nedz
2014-03-31, 11:54 PM
Seems fine now — thanks.


Yeah that update seems to fix most of the issues.

Using just [table] instead of [table=head] works now (and doesn't use the [th] tags, which is good), but doesn't set the table class to grid.
Other classes are possible: outer_border also exists

The-Mage-King
2014-04-12, 12:49 PM
Just bumping to say that the converter now supports the new classes.

Gullara
2014-04-15, 12:18 AM
Thank your friend for me. I had a couple monstrous tables that needed updating, and this made it incredibly simple.

I did find one issue. It doesn't matter to me, but this seems to strip out any formatting that was in the old cells. It might be an issue for some people.

hoverfrog
2014-05-18, 03:59 AM
This is really useful. I have a ridiculous number of posts and games with tables in plus my Useful Resources (http://www.giantitp.com/forums/showthread.php?311431-Useful-resources&p=16305757#post16305757) post with tracking tables in that I updated manually. This has prompted me to go through it again and add some small improvements.

hoverfrog
2014-05-23, 05:13 AM
I click it and nothing happens. Any idea what the problem is? 。。Have you changed the first curly bracket to a square bracket?

Mikka
2016-04-17, 01:35 AM
I can't get it to work :(

Trying to rescue these amazing resources: http://www.giantitp.com/forums/showthread.php?235754-E6-Comprehensive-Magic-Item-Lists