Author Topic: New code: Advanced tables (Now with sorting)  (Read 24335 times)

Offline Prime32

  • Over-Underling
  • Retired Admin
  • *****
  • Posts: 2914
    • View Profile
Re: New code: Advanced tables
« Reply #20 on: December 06, 2011, 01:34:30 PM »
When using nested table2s, if an outer table2 has cell borders enabled, all inner tables will also have cell borders, regardless of their parameters.
Sorry, I can't find a way to stop that. CSS child selectors aren't working beyond one level.

Offline Garryl

  • DnD Handbook Writer
  • ****
  • Posts: 4503
    • View Profile
Re: New code: Advanced tables
« Reply #21 on: December 06, 2011, 02:04:45 PM »
Would it be possible for the table2 code to ignore everything outside of cell blocks instead of pushing them above the table? It currently ignores one newline between each cell, but anything more gets pushed to above the table. It would be nice to be able to place extra lines between cells, particularly when dealing with nested tables.




Edit: Nested tables also change widths, and thus heights, when dealing with different-sized browser windows, as the rows of different nested tables to not align themselves like the rows of a single table do.
« Last Edit: December 06, 2011, 05:14:31 PM by Garryl »

Offline Prime32

  • Over-Underling
  • Retired Admin
  • *****
  • Posts: 2914
    • View Profile
Re: New code: Advanced tables
« Reply #22 on: December 08, 2011, 08:55:45 AM »
Added [table2=collapse] for seamless nested tables, an example of which can be seen here.

Offline Garryl

  • DnD Handbook Writer
  • ****
  • Posts: 4503
    • View Profile
Re: New code: Advanced tables
« Reply #23 on: December 20, 2011, 04:24:11 PM »
Prime, can you add a transpose option to the tables, where it just transposes the cells?

Offline Prime32

  • Over-Underling
  • Retired Admin
  • *****
  • Posts: 2914
    • View Profile
Re: New code: Advanced tables
« Reply #24 on: December 20, 2011, 04:34:28 PM »
I'm not completely sure what you mean, but I don't think that's possible.

Offline Garryl

  • DnD Handbook Writer
  • ****
  • Posts: 4503
    • View Profile
Re: New code: Advanced tables
« Reply #25 on: December 20, 2011, 05:40:38 PM »
Transpose. I'm just looking for ways to do the vertical tables as a single table, rather than a supertable and subtables for each column, which leads to the rows of the subtables having to be manually aligned, thus breaking alignment if any extra lines get added (such as by a smaller screen size forcing the text of a wide cell into multiple lines).

Offline SorO_Lost

  • Epic Member
  • ****
  • Posts: 7197
  • Banned
    • View Profile
Re: New code: Advanced tables
« Reply #26 on: December 20, 2011, 07:06:44 PM »
I'm just looking for ways to do the vertical tables as a single table.
As I mentioned before, DIV & float left.

Paste this in notepad and save as an html file.
Code: [Select]
<div name="Vertical Table">
<div style="float: left; background-color:#996666;">
Row one, column one.<br>
Row two, column one.<br>
Row three, column one.<br>
</div>
<div style="float: left; background-color:#669966;">
Row one, column two.<br>
Row two, column two.<br>
Row three, column two.<br>
</div>
<div style="float: left; background-color:#666699;">
Row one, column three.<br>
Row two, column three.<br>
Row three, column three.<br>
</div>
</div>

Who uses tables to begin with?

Offline Prime32

  • Over-Underling
  • Retired Admin
  • *****
  • Posts: 2914
    • View Profile
Re: New code: Advanced tables
« Reply #27 on: December 27, 2011, 03:23:18 PM »
Compare these two tables. Now look at the code.
(click to show/hide)


(click to show/hide)

Offline sirpercival

  • Epic Member
  • ****
  • Posts: 10855
  • you can't escape the miles
    • View Profile
Re: New code: Advanced tables
« Reply #28 on: December 27, 2011, 04:09:34 PM »
I don't see the orange... :(

EDIT: Now I do... weird. Very nice!
I am the assassin of productivity

(member in good standing of the troll-feeders guild)

It's begun — my things have overgrown the previous sig.

Offline SorO_Lost

  • Epic Member
  • ****
  • Posts: 7197
  • Banned
    • View Profile
Re: New code: Advanced tables
« Reply #29 on: December 27, 2011, 10:04:27 PM »
Spiffy auto colorer there for orange presets.

Offline sirpercival

  • Epic Member
  • ****
  • Posts: 10855
  • you can't escape the miles
    • View Profile
Re: New code: Advanced tables
« Reply #30 on: January 04, 2012, 10:01:11 PM »
Can anyone tell me why this nested, orange table isn't working?

Table: Arcana DCs
Arcana DC
Task
10Answer a very easy question relating to relevant subjects.
15Answer a basic question relating to relevant subjects.
20Answer a difficult question relating to relevant subjects.
30Answer a very difficult question relating to relevant subjects.
10 + monster's HDIdentify a construct, dragon, or magical beast.
13When using read magic, identify a glyph of warding. No action required.
15 + spell levelIdentify a spell being cast. (You must see or hear the spell’s verbal or somatic components.) No action required. No retry.
15 + spell levelLearn a spell from a spellcrystal (crystal mage only). No retry for that spell until you gain at least 1 rank in Spellcraft (even if you find another source to try to learn the spell from). Requires 8 hours.
15 + spell levelPrepare a spell from a borrowed spellcrystal (crystal mage only). One try per day. No extra time required.
15 + spell levelWhen casting detect magic, determine the school of magic involved in the aura of a single item or creature you can see. (If the aura is not a spell effect, the DC is 15 + one-half caster level.) No action required.
19When using read magic, identify a symbol. No action required.
20 + spell levelIdentify a spell that’s already in place and in effect. You must be able to see or detect the effects of the spell. No action required. No retry.
20 + spell levelIdentify materials created or shaped by magic, such as noting that an iron wall is the result of a wall of iron spell. No action required. No retry.
20 + spell levelDecipher a written spell (such as a scroll) without using read magic. One try per day. Requires a full-round action.
25 + spell levelAfter rolling a saving throw against a spell targeted on you, determine what that spell was. No action required. No retry.
25Identify a potion. Requires 1 minute. No retry.
20Draw a diagram to allow dimensional anchor to be cast on a magic circle spell. Requires 10 minutes. No retry. This check is made secretly so you do not know the result.
30 or higherUnderstand a strange or unique magical effect, such as the effects of a magic stream. Time required varies. No retry.
[/cell][/row][/table2]

Code: [Select]
[table2]
[row][cell][glow=maroon,2,300][b]Table: Arcana DCs[/b][/glow][/cell][/row]
[row][cell][table2=orange][row=#CCCCFF][b]Arcana DC[/b][/cell][cell][b]Task[/b][/cell][/row]
[row2][cell]10[/cell][cell]Answer a very easy question relating to relevant subjects.[/cell][/row2]
[row][cell]15[/cell][cell]Answer a basic question relating to relevant subjects.[/cell][/row]
[row2][cell]20[/cell][cell]Answer a difficult question relating to relevant subjects.[/cell][/row2]
[row][cell]30[/cell][cell]Answer a very difficult question relating to relevant subjects.[/cell][/row]
[row2][cell]10 + monster's HD[/cell][cell]Identify a construct, dragon, or magical beast.[/cell][/row2]
[row][cell]13[/cell][cell]When using read magic, identify a glyph of warding. No action required.[/cell][/row]
[row2][cell]15 + spell level[/cell][cell]Identify a spell being cast. (You must see or hear the spell’s verbal or somatic components.) No action required. No retry.[/cell][/row2]
[row][cell]15 + spell level[/cell][cell]Learn a spell from a spellcrystal (crystal mage only). No retry for that spell until you gain at least 1 rank in Spellcraft (even if you find another source to try to learn the spell from). Requires 8 hours.[/cell][/row]
[row2][cell]15 + spell level[/cell][cell]Prepare a spell from a borrowed spellcrystal (crystal mage only). One try per day. No extra time required.[/cell][/row2]
[row][cell]15 + spell level[/cell][cell]When casting detect magic, determine the school of magic involved in the aura of a single item or creature you can see. (If the aura is not a spell effect, the DC is 15 + one-half caster level.) No action required.[/cell][/row]
[row2][cell]19[/cell][cell]When using read magic, identify a symbol. No action required.[/cell][/row2]
[row][cell]20 + spell level[/cell][cell]Identify a spell that’s already in place and in effect. You must be able to see or detect the effects of the spell. No action required. No retry.[/cell][/row]
[row2][cell]20 + spell level[/cell][cell]Identify materials created or shaped by magic, such as noting that an iron wall is the result of a wall of iron spell. No action required. No retry.[/cell][/row2]
[row][cell]20 + spell level[/cell][cell]Decipher a written spell (such as a scroll) without using read magic. One try per day. Requires a full-round action.[/cell][/row]
[row2][cell]25 + spell level[/cell][cell]After rolling a saving throw against a spell targeted on you, determine what that spell was. No action required. No retry.[/cell][/row2]
[row][cell]25[/cell][cell]Identify a potion. Requires 1 minute. No retry.[/cell][/row]
[row2][cell]20[/cell][cell]Draw a diagram to allow dimensional anchor to be cast on a magic circle spell. Requires 10 minutes. No retry. This check is made secretly so you do not know the result.[/cell][/row2]
[row][cell]30 or higher[/cell][cell]Understand a strange or unique magical effect, such as the effects of a magic stream. Time required varies. No retry.[/cell][/row][/table2]
[/cell][/row][/table2]
I am the assassin of productivity

(member in good standing of the troll-feeders guild)

It's begun — my things have overgrown the previous sig.

Offline SorO_Lost

  • Epic Member
  • ****
  • Posts: 7197
  • Banned
    • View Profile
Re: New code: Advanced tables
« Reply #31 on: January 04, 2012, 10:13:15 PM »
Because it is buggy than hell? Try looking at the arrangement.

                        

Quote
A quote block

R1C1
R2C1
                        

*****
**********
***************
**********
*****

Code: [Select]
My post is as follows

Because it is buggy than hell? Try looking at the arrangement.

[table2=orange]
[row]
[cell]R1C1[/cell]
[/row]
[row2]
[cell]R2C1[/cell]
[/row2]
[/table]

[quote]A quote block[/quote]

[table2=orange]
[row]
[cell]R1C1[/cell]
[/row]
[row2]
[cell]R2C1[/cell]
[/row2]
[/table]

[center]*****
**********
***************
**********
*****[/center]

Code block here.
R1C1
R2C1
« Last Edit: January 04, 2012, 10:22:03 PM by SorO_Lost »

Offline sirpercival

  • Epic Member
  • ****
  • Posts: 10855
  • you can't escape the miles
    • View Profile
Re: New code: Advanced tables
« Reply #32 on: January 04, 2012, 10:33:42 PM »
Ah, I found the problem.  Thanks, SorO!
I am the assassin of productivity

(member in good standing of the troll-feeders guild)

It's begun — my things have overgrown the previous sig.

Offline ariasderros

  • Epic Member
  • ****
  • Posts: 2507
  • PM me what you're giving Kudos for please.
    • View Profile
Re: New code: Advanced tables
« Reply #33 on: March 19, 2012, 11:20:33 AM »
I had origionaly posted this in the wrong thread (I was in the wrong tab of what I'd had up :blush):
Are there any other colours supported other than orange?
Because I would like to make Pink (fuchsia, pink is to light), Blue and Green tables, but haven't been able to figure out how.
And got this answer:
You can use hex code colors to alter it, use row=#FFFFFF, replacing the FFFFFF with the correct code.  Wikipedia has a list, and I'm sure you can find a more comprehensive list somewhere else.

What I'm asking about is (table2=orange) seems to be the only colour that works on its own, w/o manually changing each individual line of the row code. Which, with collapsed tables, is a PITA.
My new Sig
Hi, Welcome

Offline Prime32

  • Over-Underling
  • Retired Admin
  • *****
  • Posts: 2914
    • View Profile
Re: New code: Advanced tables (Now with sorting)
« Reply #34 on: September 18, 2012, 01:49:04 PM »
Two new additions!

First, [table2=rows] produces a table with a vertical lines above each row.

Second, there is now a [tablesort] tag which works in the same way as [table2]. Using it lets you click on the table's headings to sort it in ascending or descending order (and also makes headings bold). Be warned, when the rows sort they bring their background colours with them, so it will screw up alternating row colours if you're using them. In the Preview window it will just render as [table2].


Example of both below, borrowed from sirpercival's thread here (which is the reason I looked into this).
(click to show/hide)
« Last Edit: September 18, 2012, 02:02:27 PM by Prime32 »

Offline sirpercival

  • Epic Member
  • ****
  • Posts: 10855
  • you can't escape the miles
    • View Profile
Re: New code: Advanced tables (Now with sorting)
« Reply #35 on: September 18, 2012, 04:01:35 PM »
Awesome!  Except... I can't sort that... :(
I am the assassin of productivity

(member in good standing of the troll-feeders guild)

It's begun — my things have overgrown the previous sig.

Offline Nanshork

  • Homebrew Reviewer
  • Administrator
  • *****
  • Posts: 13393
    • View Profile
Re: New code: Advanced tables (Now with sorting)
« Reply #36 on: September 18, 2012, 04:21:11 PM »
Neither can I.

Offline sirpercival

  • Epic Member
  • ****
  • Posts: 10855
  • you can't escape the miles
    • View Profile
Re: New code: Advanced tables (Now with sorting)
« Reply #37 on: September 18, 2012, 04:25:28 PM »
also, is there a way to combine different table2 options?  Like orange, rows, sort, and borders?  In various combinations?
I am the assassin of productivity

(member in good standing of the troll-feeders guild)

It's begun — my things have overgrown the previous sig.

Offline Prime32

  • Over-Underling
  • Retired Admin
  • *****
  • Posts: 2914
    • View Profile
Re: New code: Advanced tables (Now with sorting)
« Reply #38 on: September 18, 2012, 04:34:34 PM »
 :??? I've tested in IE, Firefox and Opera, what browsers are you using? The inner workings should be identical to GitP's sort function.

also, is there a way to combine different table2 options?  Like orange, rows, sort, and borders?  In various combinations?
The styles can't be combined with each other; sorting uses a different tag so you can apply any style to it you could normally.
« Last Edit: September 18, 2012, 04:42:18 PM by Prime32 »

Offline sirpercival

  • Epic Member
  • ****
  • Posts: 10855
  • you can't escape the miles
    • View Profile
Re: New code: Advanced tables (Now with sorting)
« Reply #39 on: September 18, 2012, 04:38:33 PM »
:??? I've tested in IE, Firefox and Opera, what browsers are you using?

also, is there a way to combine different table2 options?  Like orange, rows, sort, and borders?  In various combinations?
The styles can't be combined with each other; sorting uses a different tag so you can apply any style to it you could normally.

I'm using Chrome.  It does work on Safari & Firefox on my computer, however.

So I would do tablesort=orange or somesuch?  cool.
I am the assassin of productivity

(member in good standing of the troll-feeders guild)

It's begun — my things have overgrown the previous sig.