Page 1 of 2 12 LastLast
Results 1 to 30 of 36

Thread: Table Tag

  1. #1
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Table Tag

    Credit to Mouzafphaerre for this.

    Table tag. Table tags are normally dangerous for forum layouts, for example because it isn't closed properly. This hack does not have that unwanted side effect as far as I can see. Usage may be a bit confusing at first, but I guess anyone can get used to it. The hack is still under development, so it may become more userfriendly.

    It works pretty simple {table} or {table 1 2 3} is the opening tag and {/table} closes it. Difference is tableborder, padding and spacing (use numbers to your liking). Each new line is a row. A | makes a new cell. There are also 7 styles that can be used for each line. Use them like this 5^ . Style 7 is default and can be omited. Use [ instead of { and ] instead of }.

    {table 1 3 0}
    1|2|test 16798789789797979799879797979|4|5|6|7
    1^~right with colspan
    2^333|=center with colspan
    3^1|2|left with colspan
    4^1|~center without colspan|3|4|5|6|7
    5^1|blablabla|3|4|5
    6^1|2|3|4|5|6|7
    {/table}

    Gives


    Just {table}


    I've briefly tested it and this hack seems to be ok, it will be removed however until /unless it gets improved when there are unwanted effects.

    Feel free to experiment away and have fun.
    Ja mata

    TosaInu

  2. #2
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Note: the WYSIWYG mode does not allow to edit the table after it's posted, that happens with some other code too. Use the normal editor then (UserCP/edit options).
    Ja mata

    TosaInu

  3. #3
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    Just playing about with it now - looks excellent. A great addition for presenting research data. Thanks very much Tosa for the work, and Mouzafphaerre for the idea.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  4. #4
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    A question: I'm trying to format this data into a table. I've chosen {table 1 2 2} as my options, and each entry is centred with no style. The problem seems to be that every so often the "=" appears or there is a space in between figures. I've manually checked through the table (the data was generated by a script) but I can find no obvious reason for the aberrations. Any ideas on what is causing it? I fiddled with the settings a little, but no joy.

    Edit: Removed one decimal place in the 2nd column of affected rows, and the problem seems to vanish. Very curious...

    Oh well, they were extraneous digits anyway.

    Last edited by therother; 12-23-2004 at 11:39.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  5. #5
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Default Re: Table Tag

    -
    Many thanks for making my humble idea a reality, and with an ingenius hack, dear patron.


    _
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  6. #6
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Lightbulb Re: Table Tag

    -
    Oh most honourable Tosa Inu sama,

    It seems that the table tag has a problem with smiley text codes (eg. ) but image tags work perfectly.
    Also, is there a way to hack the each linebreak makes a new row rule to enable multiple lines per cell?
    -
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  7. #7
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Hello Mouzafphaerre,

    It's a hack made by JohnWoo, I only added it.

    Smilycodes, ok will see. I assume you want more than one line in a cell?
    Ja mata

    TosaInu

  8. #8
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Default Re: Table Tag

    -
    Yes, more than a line per cell would be better. Smileycodes aren't as big a problem since they can always be inserted as images when necessary.
    -
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  9. #9
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    therother, seems that each cell is using = from a worksheet? I'm pretty sure that shouldn't be there (possibly only visible in the WYSIWYG editor).


    It's not perfect (adds a space between bl and a near end) but it should do in some cases.

    It's adding extra " with the smiley, I guess the textparser can be fixed for this.
    Ja mata

    TosaInu

  10. #10
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Default Re: Table Tag

    -
    Thank you very much Tosa. I believe I can hack the autobreaking lines with my own tricks for now.
    -
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  11. #11
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    These are some entries that aren't formatted quite right -

    The 1st, 3rd and 4th have the "=" displayed instead of aligning the text in the centre. The 2nd one is different - under the CufForm Column, 10 is displayed as 1 0 for some reason.

    As a say above, removing any character on the left hand side of the aberation removes the problem.

    Hmm, now this is curious: this is the code for the table, pasted into the standard editor from notepad:
    Code:
    3^=Name|=Dist|=Dist-10|=Game %|=WithRules|=Diff|=CurForm|=Diff2|=Dist|=Dist-10
    2^=Thermon|=19.6977156|=9.697715604|=10|=10|=0|=5|=-5|=19.6977156|=9.697715604
    2^=Larissa|=22.36067977|=12.36067977|=10|=10|=0|=10|=0|=22.36067977|=12.36067977
    2^=Thessalonica|=24.51530134|=14.51530134|=15|=15|=0|=10|=-5|=24.
    2^=Segestica|=28.46049894|=18.46049894|=15|=20|=5|=15|=0|=28.46049894|=18.46049894
    Notice the spaces, and crucially the position of them. I wonder why this is?
    Last edited by therother; 12-23-2004 at 11:42.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  12. #12
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Hello therother,

    It's an odd thing, but try skipping the = signs in the input, they are not required.
    Ja mata

    TosaInu

  13. #13
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    Quote Originally Posted by TosaInu
    It's an odd thing, but try skipping the = signs in the input, they are not required.
    I don't think that it's the = sign that is causing the problem - the board seems to add a space into "words" over 60 characters in length:

    For example:

    1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890

    There are no spaces in that number, yet one is added after the 60th character, and again after the 120th.

    This explains the mysterious =, as the table was entered without spaces, as well as the odd spaces that appear in the table.

    A "=" appears when the 60th character is after the division marker |, so something entered as "|=60" becomes "| =60", resulting in the = being displayed instead of centring the text.

    A workaround would be to insert spaces before the |, and try not to use 60 digit numbers or 60 character words!

    And so the hack itself is exonerated.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  14. #14
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Yes, there's adding of spaces. That's something that showed up with the linebreak 'test'. Typing '=' signs in cells is redundant here as they are not required. It may not cause the problem, but the specific problem in above example can be avoided by deleting =.

    Code:
    3^Name|Dist|Dist-10|Game %|WithRules|Diff|CurForm|Diff2|Dist|Dist-10
    7^Thermon|19.6977156|9.697715604|10|10|0|5|-5|19.6977156|9.697715604
    7^Larissa|22.36067977|12.36067977|10|10|0|10|0|22.36067977|12.36067977
    7^Thessalonica|24.51530134|14.51530134|15|15|0|10|-5|24.
    7^Segestica|28.46049894|18.46049894|15|20|5|15|0|28.46049894|18.46049894
    Ja mata

    TosaInu

  15. #15
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    What you say is true. However, the ability to align text is useful, especially if there is a wide range of column widths.
    e.g.
    [table 1 2 2]=This is a wide column|=Narrow
    =Narrow|=narrow[/table]
    To me, the 2nd version just looks nicer, and is easier to read.

    I still think the best solution, in terms of data fidelity, is to ensure that no entry is more than 60 characters in length, as this will eliminate both the extra spaces and any erroneously displayed alignment characters (i.e. = and/or ~).

    For example, in the table without the = signs above, we have entries of

    22. 36067977
    2 8.46049894

    Your eye can certainly compensate for these errors when reading, but if the table is presenting data to be copied and pasted by members, then 2 8.46049894 is not the same as 28.46049894, and you may not notice the spaces when you've just copied a 100x6 table!

    Edit: This is a centred version of the table above, with a space inserted after the Game % entry. As the Column is 6 characters wide in any case, it makes no difference to the appearance of the table, as the extra space seems to be chopped off, i.e. it doesn't appear when you copy the table and paste it into a local application (e.g. a spreadsheet).

    Last edited by therother; 12-23-2004 at 12:30.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  16. #16
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    I notice that a number of tables (including some in this thread) are now not being displayed correctly. Is this just a temporary glitch, or has the hack been removed?
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  17. #17
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Default Re: Table Tag

    -
    It seems to have gone, hopefully not for the good.
    -
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  18. #18
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    Quote Originally Posted by Mouzafphaerre
    It seems to have gone, hopefully not for the good.
    I don't know if you've noticed, but it's back: apparently one of the patches overwrote the table tag code, but TosaInu managed to fix it.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  19. #19
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Smile Re: Table Tag

    -
    I noticed but was lazy to fix my comment. Hail Tosa!
    -
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  20. #20
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Not so hail as I didn't even notice it was broken. Credit to therother for spotting it.
    Ja mata

    TosaInu

  21. #21
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Exclamation Re: Table Tag

    .
    We have a situation sir:
    Quote Originally Posted by The samnite
    ...it breaks without editing after one viewing. I tried again in the same thread for a new post.

    So a more detailed description:

    I start a new topic, use the table code {table 1 3 0} to start and {/table} to end. Used only 2 columns, and used 4^ to highlight some rows.

    I post the message, and it takes me to the post and the table looks fine. I either refresh the page or click on the topic again and the table code breaks. It looks like the exact code in the editor.

    If I edit again in standard mode and save changes in fixes it again. However it breaks once again after I refresh the page. I can continue this cycle forever it seems.
    Could it be related with the trouble with the code tag, as in both originating from the same glitch?
    .
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  22. #22
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    Hmm, I have a few tables around the forums, and bar the new Table code being a bit more fastiduous about spaces, it seems to work pretty much the same as the old one.

    Testing:


    Edit: Hmm, odd. Disappeared on refresh. Doesn't happen with my table here.
    Last edited by therother; 10-19-2005 at 13:35.
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  23. #23
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Strange things.
    Ja mata

    TosaInu

  24. #24
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Ja mata

    TosaInu

  25. #25
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Quick-fixed.
    Ja mata

    TosaInu

  26. #26

    Default Re: Table Tag

    Quote Originally Posted by TosaInu
    bold
    You know that 7(squared) is 49? Not 47.

  27. #27
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Tables are now using an extra = in the option list table= x x x
    Ja mata

    TosaInu

  28. #28
    Research Fiend Technical Administrator Tetris Champion, Summer Games Champion, Snakeman Champion, Ms Pacman Champion therother's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    2,640

    Default Re: Table Tag

    Also, if you just want a simple table, without the further settings, you have to add in the = as well.

    e.g.
    [table=]1|1
    2|8
    3|27[/table]

    Gives:
    Nullius addictus iurare in verba magistri -- Quintus Horatius Flaccus

    History is a pack of lies about events that never happened told by people who weren't there -- George Santayana

  29. #29
    Urwendur Ûrîbêl Senior Member Mouzafphaerre's Avatar
    Join Date
    Nov 2003
    Location
    Mikligarðr
    Posts
    6,899

    Thumbs up Re: Table Tag

    .
    .
    Ja mata Tosa Inu-sama, Hore Tore, Adrian II, Sigurd, Fragony

    Mouzafphaerre is known elsewhere as Urwendil/Urwendur/Kibilturg...
    .

  30. #30
    Nur-ad-Din Forum Administrator TosaInu's Avatar
    Join Date
    Jul 2002
    Posts
    12,326

    Default Re: Table Tag

    Most credit goes to the genuine PHP coder who fixed it.
    Ja mata

    TosaInu

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO