Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to Anonymous,bruncher,niord,gvonge,Shelford, for Donating to support the site

Re:How to add tables

Formerly "Lemon Fool - Improve the Recipe" repurposed as Room 102 (see above).
mc2fool
Lemon Half
Posts: 8082
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3121 times

Re: Re:How to add tables

#12320

Postby mc2fool » December 5th, 2016, 11:20 pm

kiloran wrote:This has already been modified to have the code tags (instead of the <pre> tags used by TMF)

Well, you may well want to change it to using the [­pre] tags that either have just been introduced or I've only just noticed.

[pre] looks better as it puts things "inline" in the text of the post, as it did on TMF

Code: Select all

As opposed to [code] which puts things in their own box

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2631 times

Re: Questions re "HOW TO ADD TABLES"

#12337

Postby Gengulphus » December 6th, 2016, 3:07 am

uspaul666 wrote:I was able to determine, to some extent, how the table thing worked, by selecting "view source" in the browser when on the preview post page.


Thanks - thought I'd looked for such things, but obviously I hadn't looked in quite the right place!

And thanks, stooz, for making the tables easier on the eye! Some suggestions after having a look at what uspaul666 has pointed out:

* Possibly change the column separator to be "&&" rather than just a single "&" - that would make it possible to have entries like "Marks & Spencer" in tables, and the only likely uses of "&&" that I can think of would be in Code boxes rather than tables.

* Or possibly change it to "||" to make it more intuitively memorable, suggesting a vertical line column separator?

* Closing brackets ")", "]" or "}" are unlikely characters to be wanted at the start of a table item, and similarly opening brackets "(", "[" or "{" are unlikely characters to be wanted at the end of a table item. One of the former could be used to indicate moving stuff over to the right, i.e. right-aligning the item, and the matching one of the latter could similarly be used to indicate left-alignment. (Unfortunately, while ">" and "<" would be the most intuitive pair because they clearly point in the correct directions, table entries starting with ">" for "greater than" are quite likely.)

I should say that having looked at the code uspaul666 has pointed out, I think all of the above should be straightforward - but I'm not familiar enough with JavaScript to be 100% certain of that!

Gengulphus

Breelander
Lemon Quarter
Posts: 4184
Joined: November 4th, 2016, 9:42 pm
Has thanked: 1016 times
Been thanked: 1858 times

Re: Re:How to add tables

#12338

Postby Breelander » December 6th, 2016, 3:30 am

mc2fool wrote:
[pre] looks better as it puts things "inline" in the text of the post, as it did on TMF



BBcode is safer (from the forum's point of view) because it keeps posters at arms length from writing 'raw' html and allows some of the more dangerous html options to be removed/ignored before arriving in the finished post. In the case of this [ pre ] BBcode, it's a straight translation to the html <pre> - so it's no surprise it works exactly the same as it did on TMF.

As on TMF, where you could nest other html tags (like <i></i> and <b></b>) within the <pre></pre> tags, so you can use BBcode tags here. Of particular use in financial tables would be colour for gains/losses.


Share Price Change on the year Yield
name (p) (p) (%) (%)

ABC 100.0 0 0 3.5
DEF 61.75 -2.4 -3.7 4.2
GHI 1201.5 175.8 12.8 1.3

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2631 times

Re: Re:How to add tables

#12339

Postby Gengulphus » December 6th, 2016, 4:08 am

Breelander wrote:BBcode is safer (from the forum's point of view) because it keeps posters at arms length from writing 'raw' html and allows some of the more dangerous html options to be removed/ignored before arriving in the finished post. In the case of this [ pre ] BBcode, it's a straight translation to the html <pre> - so it's no surprise it works exactly the same as it did on TMF.


Except that it doesn't work exactly the same as on TMF! It differs in a good way, namely that it will force line breaks to happen if you make lines too long - which typically happens when someone forgets that they have to enter the line breaks themselves, or when (as in my one memorable encounter with the problem) they inadvertently produce a lot of spaces at the end of a line. On TMF that just made the post wide enough to accommodate the widest line in the <pre>...</pre> section, enabling horizontal scrolling if necessary - which was horrible, especially if you were reading in whole-thread mode where the software would make every post as wide as the widest one!

Gengulphus

mc2fool
Lemon Half
Posts: 8082
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3121 times

Re: Re:How to add tables

#12389

Postby mc2fool » December 6th, 2016, 9:34 am

Breelander wrote:BBcode is safer (from the forum's point of view) because it keeps posters at arms length from writing 'raw' html and allows some of the more dangerous html options to be removed/ignored before arriving in the finished post.

Eh? Safer than what? TMF stripped out all HTML except the very few tags it allowed, and (AFAIK) phpBB removes all HTML not just "some of the more dangerous" ones.
Breelander wrote: In the case of this [ pre ] BBcode, it's a straight translation to the html <pre> - so it's no surprise it works exactly the same as it did on TMF.

As on TMF, where you could nest other html tags (like <i></i> and <b></b>) within the <pre></pre> tags, so you can use BBcode tags here. Of particular use in financial tables would be colour for gains/losses.

Grandmother, eggs.

mc2fool
Lemon Half
Posts: 8082
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3121 times

Re: Re:How to add tables

#12395

Postby mc2fool » December 6th, 2016, 9:45 am

Gengulphus wrote:Except that it doesn't work exactly the same as on TMF! It differs in a good way, namely that it will force line breaks to happen if you make lines too long

Uh?

This is a very long line in pre tags that I am repeatedly copying and pasting. 2 This is a very long line in pre tags that I am repeatedly copying and pasting. 3 This is a very long line in pre tags that I am repeatedly copying and pasting. 4  This is a very long line in pre tags that I am repeatedly copying and pasting. 5  This is a very long line in pre tags that I am repeatedly copying and pasting. 6 This is a very long line in pre tags that I am repeatedly copying and pasting. 7  This is a very long line in pre tags that I am repeatedly copying and pasting. 8  This is a very long line in pre tags that I am repeatedly copying and pasting.  9 This is a very long line in pre tags that I am repeatedly copying and pasting.

A horizontal scroll bar for just this post is what I call differing in a good way, not forcing line breaks into my formatting...

Now, if we could just get rid of that superfluous right hand panel, so we could usefully use the whole width of the window :D

redsturgeon
Lemon Half
Posts: 9022
Joined: November 4th, 2016, 9:06 am
Has thanked: 1346 times
Been thanked: 3739 times

Re: Re:How to add tables

#12403

Postby redsturgeon » December 6th, 2016, 9:58 am

mc2fool wrote:
Breelander wrote:BBcode is safer (from the forum's point of view) because it keeps posters at arms length from writing 'raw' html and allows some of the more dangerous html options to be removed/ignored before arriving in the finished post.

Eh? Safer than what? TMF stripped out all HTML except the very few tags it allowed, and (AFAIK) phpBB removes all HTML not just "some of the more dangerous" ones.
Breelander wrote: In the case of this [ pre ] BBcode, it's a straight translation to the html <pre> - so it's no surprise it works exactly the same as it did on TMF.

As on TMF, where you could nest other html tags (like <i></i> and <b></b>) within the <pre></pre> tags, so you can use BBcode tags here. Of particular use in financial tables would be colour for gains/losses.

Grandmother, eggs.


mc2fool, please be aware that some of us actually may not be grandmothers and would find a quick course in egg sucking quite enlightening.

John

mc2fool
Lemon Half
Posts: 8082
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3121 times

Re: Re:How to add tables

#12410

Postby mc2fool » December 6th, 2016, 10:05 am

John, here you go (on a quick search, better guides may be available :D ). http://www.phpbb.com/community/faq.php?mode=bbcode

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2631 times

Re: Re:How to add tables

#12412

Postby Gengulphus » December 6th, 2016, 10:10 am

mc2fool wrote:
Gengulphus wrote:Except that it doesn't work exactly the same as on TMF! It differs in a good way, namely that it will force line breaks to happen if you make lines too long

Uh?
...
A horizontal scroll bar for just this post is what I call differing in a good way, not forcing line breaks into my formatting...


But TMF didn't produce a horizontal scroll bar for just the post concerned - one person's excessively wide formatting could cause every post in whole-thread view to require horizontal scrolling. IMHO forcing line breaks into your formatting is definitely a less bad problem than forcing horizontal scrolling of everyone else's posts, so I stick to my opinion that the solution here differs from the solution at TMF in a good way.

Whether a hypothetical solution here in which excessively wide formatting causes horizontal scrolling of your post only would be better than both the TMF solution and the current solution here is debatable, but I was comparing the two solutions I've actually seen, not other as-yet-hypothetical solutions!

Gengulphus

mc2fool
Lemon Half
Posts: 8082
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3121 times

Re: Re:How to add tables

#12416

Postby mc2fool » December 6th, 2016, 10:17 am

Gengulphus wrote:Whether a hypothetical solution here in which excessively wide formatting causes horizontal scrolling of your post only would be better than both the TMF solution and the current solution here is debatable, but I was comparing the two solutions I've actually seen, not other as-yet-hypothetical solutions!

Uh? What hypothetical solution?!? Or are we seeing entirely different things?

My post above has a very (very) long line in a pre tag. The board (unlike what you said) does not introduce any line breaks but does add a horizontal scroll bar to just that post. That's what I'm seeing at least, and why I posted my previous "Uh"?, are you seeing something different?

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2631 times

Re: Re:How to add tables

#12430

Postby Gengulphus » December 6th, 2016, 11:20 am

mc2fool wrote:
Gengulphus wrote:Whether a hypothetical solution here in which excessively wide formatting causes horizontal scrolling of your post only would be better than both the TMF solution and the current solution here is debatable, but I was comparing the two solutions I've actually seen, not other as-yet-hypothetical solutions!

Uh? What hypothetical solution?!? Or are we seeing entirely different things?

My post above has a very (very) long line in a pre tag. The board (unlike what you said) does not introduce any line breaks but does add a horizontal scroll bar to just that post. That's what I'm seeing at least, and why I posted my previous "Uh"?, are you seeing something different?


Ah! Yes, I'm seeing it forcibly wrapped every 110 characters, like this:

This is a very long line in pre tags that I am repeatedly copying and pasting. 2 This is a very long line in p
re tags that I am repeatedly copying and pasting. 3 This is a very long line in pre tags that I am repeatedly
copying and pasting. 4 This is a very long line in pre tags that I am repeatedly copying and pasting. 5 This
is a very long line in pre tags that I am repeatedly copying and pasting. 6 This is a very long line in pre t
ags that I am repeatedly copying and pasting. 7 This is a very long line in pre tags that I am repeatedly cop
ying and pasting. 8 This is a very long line in pre tags that I am repeatedly copying and pasting. 9 This is
a very long line in pre tags that I am repeatedly copying and pasting.


Sorry about the misunderstanding, but in the light of that appearance to me, the obvious reading of "A horizontal scroll bar for just this post is what I call differing in a good way, not forcing line breaks into my formatting..." was that you didn't like what you saw and thought it less good than a horizontal scroll bar, not that you did like what you saw and thought it better than forced line breaks.

I'd guess a browser difference (I'm using IE11), though there could probably be other reasons. In any event, we now know an extra reason not to produce excessively wide pre-formatted material!

Gengulphus

Instep
2 Lemon pips
Posts: 162
Joined: November 4th, 2016, 4:52 pm
Has thanked: 181 times
Been thanked: 15 times

Re: Re:How to add tables

#12443

Postby Instep » December 6th, 2016, 11:55 am

Gengulphus wrote:I'd guess a browser difference (I'm using IE11), though there could probably be other reasons. In any event, we now know an extra reason not to produce excessively wide pre-formatted material!

I was coming to that conclusion after I was so pleased with my rework of your table in the HYP practical 41st purchase thread. It works fine for me in Chrome on Android phone and mini tablet and also in Chrome on Windows 10. I find it as easy to scroll around the table as in a spreadsheet.
I've not checked other browsers.
HTH
Instep
PS I'm even seeing a horizontal scroll bar on the [pre] section that you quoted, so I can scroll across to 110 characters.

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: Re:How to add tables

#12450

Postby kiloran » December 6th, 2016, 12:05 pm

Gengulphus wrote:
I'd guess a browser difference (I'm using IE11), though there could probably be other reasons. In any event, we now know an extra reason not to produce excessively wide pre-formatted material!

Gengulphus


I think you are right about the browser difference. Have a look at viewtopic.php?f=28&t=1342 which has the same data using code, table and pre tags

In Chrome, I see:
Code data has a vertical scroll bar, and the text is wrapped within the code window. The code window appears to be left-justified within the post
Table data has no scroll bars and is centre-justified horizontally within the post. Text is wrapped within each column
Pre data has a horizontal scroll bar and is left-justified within the post. The scroll bar moves all data in the post, not just the data in the pre tags

In IE11, I see:
Same as Chrome....Code data has a vertical scroll bar, and the text is wrapped within the code window. The code window appears to be left-justified within the post
Same as Chrome.....Table data has no scroll bars and is centre-justified horizontally within the post. Text is wrapped within each column
Pre data has no scroll bars, is left-justified within the post, and text is wrapped. A mess!!

In Firefox, I see:
Same as Chrome....Code data has a vertical scroll bar, and the text is wrapped within the code window. The code window appears to be left-justified within the post
Same as Chrome.....Table data has no scroll bars and is centre-justified horizontally within the post. Text is wrapped within each column
Pre data is same as Chrome....has a horizontal scroll bar and is left-justified within the post

--kiloran

stooz
Site Admin
Posts: 1468
Joined: November 3rd, 2016, 11:03 pm
Has thanked: 10 times
Been thanked: 502 times

Re: Re:How to add tables

#12456

Postby stooz » December 6th, 2016, 12:17 pm

All Change!

As recommended I have made the separator ---- ||

Two pipes.

Code: Select all

[table]L=STATISTIC||VALUE||STATISTIC||VALUE
L=Number of posts:||[i]11473[/i]||lklkl||373.79
L=Number of topics:||1163||Topics per day:||37.89
L=Number of users:||1810||[b]Users per day[/b]:||58.97[/table]


and widened the table


You can also align the text using the new align= tag - defaults to left. You can use Left, center, right (normal html text-align definitions)

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: Re:How to add tables

#12458

Postby kiloran » December 6th, 2016, 12:25 pm

stooz wrote:All Change!

As recommended I have made the separator ---- ||

Two pipes.


ARGH!!!!! :shock:
Talk about trying to hit a moving target!

--kiloran

Instep
2 Lemon pips
Posts: 162
Joined: November 4th, 2016, 4:52 pm
Has thanked: 181 times
Been thanked: 15 times

Re: Re:How to add tables

#12464

Postby Instep » December 6th, 2016, 12:33 pm

I think I'll take a Break.
Can't keep up. :)

stooz
Site Admin
Posts: 1468
Joined: November 3rd, 2016, 11:03 pm
Has thanked: 10 times
Been thanked: 502 times

Re: Re:How to add tables

#12474

Postby stooz » December 6th, 2016, 12:48 pm

No more changes! Sorry!

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: Re:How to add tables

#12477

Postby kiloran » December 6th, 2016, 12:52 pm

stooz wrote:No more changes! Sorry!

No problem stooz, it's understandable with a new site, we've all got lots to learn. Just a pity that the changes work retrospectively, so earlier posts can get screwed up.

--kiloran

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2631 times

Re: Re:How to add tables

#12482

Postby Gengulphus » December 6th, 2016, 12:55 pm

kiloran wrote:ARGH!!!!! :shock:
Talk about trying to hit a moving target!


Sorry about pushing the target around - but if incompatible changes were going to be made, they needed making asap, to minimise the number of broken tables. And the use of "&" as the separator really did look likely to me to be a problem that shouldn't be frozen into the system...

And I promise I'm done on suggesting changes that are significantly incompatible!

Gengulphus

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2631 times

Re: Re:How to add tables

#12494

Postby Gengulphus » December 6th, 2016, 1:11 pm

stooz wrote:No more changes! Sorry!


Possibly a bit of an overreaction - more changes can be done in a way that won't upset people. Essentially, by bringing in a 'table v2' option which is used for new posts while leaving the 'table' code in place to handle the old tables.

But things look good enough for the moment, so any 'table v2' changes can be saved up until (and if) they'll be a major improvement and reviewed for any problems people can see before being put in place. (Or possibly put in place via a 'table v2beta' option that is only available on a suitable testing board?)

And thanks for your efforts so far!

Gengulphus


Return to “Room 102 - Site Issues, Complaints & General Chat”

Who is online

Users browsing this forum: No registered users and 19 guests