Questions about displaying wide tables

I’m curious to understand more about the strategies that Discourse uses for displaying wide tables (that is, tables that are wide enough to overflow the containing box). This topic seems to indicate that Discourse will show an expand table button for wide tables:

And this topic seems to indicate that Discourse should show horizontal scroll bars for wide tables:

But when viewing that first topic, I don’t see either of those behaviors for the second table (on either my phone or my (Chrome) web browser with a very small window width). What is the current expected Discourse behavior for wide tables?

Wide table

Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7
12345678901234567890 12345678901234567890 12345678901234567890 12345678901234567890 12345678901234567890 12345678901234567890 12345678901234567890
1 Like

It works for me on Chrome — it’s not super obvious, but if you drag to scroll, a bar appears.

In the links, the text gets wrapped in the cells, so it ends up not being very wide.

2 Likes

I do see the scroll bar appear on the example you posted (on my phone), but not on the second table in the first post above (even though almost all of the JSON in the right column is clipped). What might be different about the two cases?

The table in that post is behaving a bit weirdly for me, and appears to be conjoined with the first one when it comes to Expand, etc.

The second table is created with HTML rather than Markdown to allow the codeblocks, so that may be what’s muddling it together, as well as not getting the scrollbar applied.

1 Like

Ah yes, I see that the author of that first post even mentions that the first table is a Markdown table and the second one is HTML, although I suppose I didn’t expect that to be relevant, at first. And then, looking at the cooked source, I see that Markdown tables (like the one @mattdm posted earlier) are wrapped in a <div class="md-table">. I wonder why there is a specific class for Markdown tables, and why Discourse only displays wide tables of that type with scroll bars. This is starting to seem like a bug to me; do others agree?

I am also still curious about the expand table button functionality. I see the button included in the cooked source for the example table from earlier in this topic and also in the cooked source for the second table (the HTML table) in the “Expand Table button shows wrong table” post, but not in the first table (the Markdown table) in that post. But those buttons are not displayed when you hover over the respective tables, as far as I can see.

1 Like