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

#12516

Postby mc2fool » December 6th, 2016, 1:44 pm

Re [pre], it does indeed seem to work differently on not only different browsers but also different versions of the same browser. Under Firefox and Chrome on my Windows 10 laptop it doesn't wrap and does put a horizontal scroll bar on the post, as it also does under Firefox on my XP system. However under IE, Chrome, Opera & Safari on my XP system it wraps and doesn't add a horizontal scroll bar. (I haven't checked the others on W10!)

The issue seems to be that in those browsers the <pre> block is inheriting the word-wrap: break-word; style from the <body> block (specified in common.css, line 64).

Using the debugging tools in each of those browsers to add the word-wrap: normal; style to the <pre> blocks fixes the problem (i.e. stops wrapping and adds a horizontal scroll bar) in all those cases, so that looks like the way to go.

Another issue I've noticed is that the text within the <pre> is enclosed in a <span style="font-family: monospace">...</span>. This seems a rather odd way to go about things, as <pre>, by default, should be a monospaced font, however that appears to be overridden by a font: inherit; in the many-tags definition at common.css line 20.

I don't know how many side effects changing those styles for <pre> in general would cause, so I'd suggest (if possible) that the way to go is to add a prebbcode class with the word-wrap: normal; and font-family: monospace; styles in it and have the [pre] tag generate <pre class="prebbcode">.

Or similar ;)

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

#12819

Postby Breelander » December 6th, 2016, 11:29 pm

Gengulphus wrote:...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


From what I can see on my own test forum it doesn't seem possible to limit a particular BBcode to just one phpBB forum. What you can do for testing purposes is to add a [table v2beta] BBcode but leave its 'Display on posting page' box unticked, only ticking it once testing is complete and it has been given its proper name. Then only those who are told its test name can use it (well, anyone could see it's test name if they 'reply with quote', but it should be obvious that its use would be at the risk of it disappearing shortly).

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

#12824

Postby Breelander » December 6th, 2016, 11:53 pm

mc2fool wrote:Re [pre], it does indeed seem to work differently on not only different browsers but also different versions of the same browser. Under Firefox and Chrome on my Windows 10 laptop it doesn't wrap... However under IE, Chrome, Opera & Safari on my XP system it wraps and doesn't add a horizontal scroll bar. (I haven't checked the others on W10!)

The issue seems to be that in those browsers the <pre> block is inheriting the word-wrap: break-word; style from the <body> block (specified in common.css, line 64).


To that list you can add that in Windows 10 Edge and IE11 wrap the text and don't add a scroll bar.

The problem for stooz is that to implement your more elegant solution involves editing the .css style sheets for the Prosilver theme and ftp'ing the modified files up to the hosting server. Hacking a theme is not something you'd want to do lightly, certainly not on a live site - it may have unexpected side-effects. It's not something that can be done within the Administrator's Control Panel either - whereas undoing the inheritance with <span style="font-family: monospace">...</span> can easily be added to the [pre] BBcode from the Control Panel.

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

#12826

Postby mc2fool » December 7th, 2016, 12:07 am

Breelander wrote:The problem for stooz is that to implement your more elegant solution involves editing the .css style sheets for the Prosilver theme and ftp'ing the modified files up to the hosting server. Hacking a theme is not something you'd want to do lightly, certainly not on a live site - it may have unexpected side-effects. It's not something that can be done within the Administrator's Control Panel either - whereas undoing the inheritance with <span style="font-family: monospace">...</span> can easily be added to the [pre] BBcode from the Control Panel.

Adding a specifically named class, as I suggested, shouldn't have any side effects in itself, however I do note that editing the style sheets for a theme will add extra faff and things to remember to (re)do when/if updating it.

I'm not familiar with how BBcodes are added ... can one not (easily) say [pre] generates <pre style="font-family: monospace; word-wrap: normal"> ... </pre> ? The <span> seems superfluous and the word-wrap: normal is definitely needed for pre to be useful.

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

#12831

Postby Breelander » December 7th, 2016, 12:31 am

mc2fool wrote:I'm not familiar with how BBcodes are added ... can one not (easily) say [pre] generates <pre style="font-family: monospace; word-wrap: normal"> ... </pre> ? The <span> seems superfluous and the word-wrap: normal is definitely needed for pre to be useful.


Thank you, that does indeed work. In the Administrator Control Panel / Posting / BBcode stooz just needs to modify 'pre' to read...

Code: Select all

BBcode useage:                   [pre]{TEXT}[/pre]
HTML Replacement:            <pre style="font-family: monospace; word-wrap: normal">{TEXT}</pre>

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

#12832

Postby mc2fool » December 7th, 2016, 12:36 am

Gengulphus wrote:Ah! Yes, I'm seeing it forcibly wrapped every 110 characters, like this:
:
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!

Yes, but the problem is that you, I, nobody knows what "excessively wide" is. E.g. for you it wrapped at 110 chars, but on my XP system your post viewtopic.php?f=21&t=1283&start=20#p12430 caused a horizontal scroll bar to appear under Firefox and in the other browsers it wrapped the last bit of each line in the [pre] section, maybe at 104 or so (I didn't count...).

What may be "excessively" wide for you may not be for someone else, and vice versa, and with all the variables involved it's impossible to be definitive -- and let's face it, wrapping in tables makes such a mess that only a couple of characters over becomes excessively wide -- so, yes, while I agree folks should try not to produce super-wide tables etc, the only universal solution is no wrapping and a horizontal scroll bar if needed.

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

#12833

Postby mc2fool » December 7th, 2016, 12:39 am

Breelander wrote:Thank you, that does indeed work.

Ahhhh, happy to know I've been of service :D

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

#12886

Postby stooz » December 7th, 2016, 9:06 am

Code: Select all

BBcode useage:                   [pre]{TEXT}[/pre]
HTML Replacement:            <pre style="font-family: monospace; word-wrap: normal">{TEXT}</pre>


Ive made it change to that. Does that help?

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

Re: Re:How to add tables

#12895

Postby Gengulphus » December 7th, 2016, 9:27 am

mc2fool wrote:
Gengulphus wrote:Ah! Yes, I'm seeing it forcibly wrapped every 110 characters, like this:
:
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!

Yes, but the problem is that you, I, nobody knows what "excessively wide" is. E.g. for you it wrapped at 110 chars, but on my XP system your post viewtopic.php?f=21&t=1283&start=20#p12430 caused a horizontal scroll bar to appear under Firefox and in the other browsers it wrapped the last bit of each line in the [pre] section, maybe at 104 or so (I didn't count...).


No, I do know what "excessively wide" means. Not in terms of an exact numerical limit (though I do note that 110 was the crucial number for both Bree and me!), but in terms of being wider than it needs to be to be fit for purpose. There's a judgement call in what "fit for purpose" means, of course - for example, my judgement is that columns need to be separated by at least two spaces for readability, especially when the items in the columns can contain spaces themselves, and that in a portfolio listing both company names and EPICs are needed, especially if one is going to seriously abbreviate the longer company names. But being wider than it need be to meet whatever "fit for purpose" judgement one comes to makes it more likely to cause problems for readers and so is excessively wide.

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

#12922

Postby mc2fool » December 7th, 2016, 11:02 am

stooz wrote:

Code: Select all

BBcode useage:                   [pre]{TEXT}[/pre]
HTML Replacement:            <pre style="font-family: monospace; word-wrap: normal">{TEXT}</pre>


Ive made it change to that. Does that help?

Yep, it now works fine for me on XP under Firefox*, Chrome, IE, Opera & Safari, and on Windows 10 under Firefox*, Chrome*, IE & Edge.

Mozilla/5 under Linux i686, which is what runs on my TV, seems to be lacking a monospaced font, so it only half works (no wrapping + scroll bar) there, but there's nothing you can do about that and I'm really not fussed about it anyway ;)

* worked before.

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

#12926

Postby mc2fool » December 7th, 2016, 11:06 am

Gengulphus wrote:No, I do know what "excessively wide" means.

For you but not for everybody else, which was my point. In any case, how does viewtopic.php?f=21&t=1283&start=20#p12395 look to you now?

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

Re: Re:How to add tables

#12940

Postby Gengulphus » December 7th, 2016, 12:04 pm

mc2fool wrote:
Gengulphus wrote:No, I do know what "excessively wide" means.

For you but not for everybody else, which was my point.


And I took that point - that's why I answered with an explanation of its intended meaning in what I had written.

mc2fool wrote:In any case, how does viewtopic.php?f=21&t=1283&start=20#p12395 look to you now?


Horizontal scrolling, no forced wrapping - i.e. what you've described.

Also excessively wide, by my definition! I.e. the content could easily be expressed in much less width, getting rid of the need for horizontal scrolling... :-P

Gengulphus

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

#13010

Postby kiloran » December 7th, 2016, 4:16 pm

With the current choice of 3 tabular structures in Lemon Fool, I've updated the web page to format spreadsheet data to a format suitable for posting tables: http://lemonfoolfinancialsoftware.weebl ... ormat.html

I hope that does not further muddy the already murky water!

--kiloran

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

#13335

Postby Breelander » December 8th, 2016, 1:49 pm

stooz wrote:No more changes! Sorry!


Additions are welcome though - the new [align=] for instance. This (and any other BBcode) can be used within each cell of a Table. See...
viewtopic.php?f=28&t=1342#p13142

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

#13339

Postby Breelander » December 8th, 2016, 2:02 pm

Breelander wrote: Additions are welcome though...


One you may like to consider is for <tt></tt>

Code: Select all

Useage:     [tt]{TEXT}[/tt]
HTML:       <span style="font-family: monospace;">{TEXT}</span>


You may want to have another look at 'strike-through' though... the first '<' seems to be missing.

tjh290633
Lemon Half
Posts: 8438
Joined: November 4th, 2016, 11:20 am
Has thanked: 937 times
Been thanked: 4246 times

Re: Re:How to add tables

#13440

Postby tjh290633 » December 8th, 2016, 6:18 pm

I have just tried to include a table on another board, using the "pre" tags. I found that all leading spaces in a row were deleted, so that my column headers were misaligned. I overcame it by adding a header for the first column.

See viewtopic.php?f=31&t=1380&start=20 for the actual post, timed at 6.09pm today.

TJH

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

#13488

Postby mc2fool » December 8th, 2016, 9:06 pm

Breelander wrote:Additions are welcome though - the new [align=] for instance. This (and any other BBcode) can be used within each cell of a Table. See...
viewtopic.php?f=28&t=1342#p13142

Hmmmm ... there's an issue here, [align=(eg)center] generates HTML of the form: <span style="display: block; text-align:center"> ... </span>.

That's a potentially problematic thing to do as <span> is an inline element, and while the css style will make it display as a block it doesn't change it, semantically, to being a block-level element.

Now, while that's not a big deal in isolation (although it is "discouraged ", see the HTML standard at https://www.w3.org/TR/html401/struct/gl ... ml#h-7.5.3) the issue comes about when other BBCodes generating block-level elements are embedded with it, as inline elements can only contain other inline elements.

E.g. A [pre] inside an [align] would generate <span ...><pre> xxx </pre></span>, which is invalid HTML, 'cos the <pre> is a block-level element and those can't be contained within an inline element, and as that's invalid HTML it's pot luck as to how browsers may choose to display it (that particular combo seems to work as you might expect in the latest Firefox on W10, but that's no guarantee either for other browsers or, indeed, for future versions of Firefox).

Now, for [align=], as (AFAICS) there's no reason or advantage to it as is, it should simply be changed to use <div> (which is a block-level element) instead, so generating, e.g. <div style="text-align:center"> ... </div>

On a more general point, AFAICS there doesn't seem to be anything in phpBB to prevent/filter out/correct invalid HTML being generated by combinations of BBCodes, and maybe that's not possible. However, I would recommend looking through the existing BBCodes to see if any of them could, in combination with others, potentially violate the HTML standard in this respect. See link above.

It's also worth testing against the W3C validitor. I.e. create a post with the BBCode combinations you want to check in the Testing 123 forum and then run the page through https://validator.w3.org/

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

Re: Re:How to add tables

#15619

Postby Gengulphus » December 16th, 2016, 9:35 am

An observation about the table facility is that if one has a right-aligned column immediately followed by a left-aligned column, no space at all is left between them:

I tried the work-around of putting in an extra column of spaces, but that doesn't work - the software seems quite happy to treat it as a column of width zero:

However, a column of non-breaking spaces is a more successful work-around (not that the difference is visible in the source, but it's there!):

There's still an issue of the headings being spread over two rows, but that's a rather minor ugliness, not a major issue.

Gengulphus


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

Who is online

Users browsing this forum: No registered users and 15 guests