Pretty display for tables
Posted: Sun Jul 12, 2009 12:56 pm
I got sick of trying to work with printTable, so I wrote my own display function. It can handle variables of any type including nested tables. It also lets you specify a format to use for number variables. Here's an example of how it looks on an arbitrary complex table:
I haven't put it through industrial-strength testing, so if you notice something strange, it's probably a bug not a feature. Let me know and I'll fix it, or feel free to do it yourself and post an updated version of the package.
Code: Select all
table {
1: 'first'
2: true
3: false
'key1': table {
1: 'You see exits leading north and south.'
2: 'exits'
3: 'leading '
4: 'north and '
5: 'north'
6: 'south'
'full table': table {
'a': 1
'c': 3
'b': 2
}
'blank table': table {}
}
'key2': 256
}