It wouldn't be that difficult to add to the bbcode parser, but it might be a good opportunity to also fix the first-column bug. Maybe:
- A border attribute would be added to the [table] tag. If you have it set, even to 0, then the first-column bug is fixed for your table (by adding/removing a CSS class)
- Existing tables without a border specified would function exactly the same as now, for backwards-compatibility.
I'll do it if someone comes up with the ideal HTML+CSS which the table tag should produce, for all three cases: [table], [table border=0], and [table border=1]. You can't remove that problematic CSS rule without addressing the fact that it's actually supposed to do something (not sure off-hand what...), and that the behavior of old [table] tags need to remain identical for backward-compatibility. So you should either work around that CSS rule or figure out exactly what it's supposed to do and fix it to be more selective while also maintaining the old behavior on old [table]s.
The buggy rule appears to be targeting this:
Edited 2020-11-30 to fix a broken imageBut someone forgot the "cascading" part of "CSS" and it now applies to post content as well.
For your suggested fix to work you would need:
- No CSS class on the tables without the border attribute - the old rule would still apply then.
- "table-new-style" class on tables with border attribute (any value), and the following CSS:
- div#bodyarea div.post table.table-new-style > tbody > tr > td:first-child { width: auto; }
- Additional "table-with-border" class on tables with border=1, and the following CSS:
- div#bodyarea div.post table.table-with-border { border-spacing: 0px; border-collapse: collapse; }
- div#bodyarea div.post table.table-with-border > tbody > tr > td { padding: 2px; border: 1px #555 solid; /* or whatever border spec you want to apply */ }
I would prefer an option to specify custom border colors but that gets a bit more complicated.
Here is an example of the suggested CSS on jackg's post:
https://bitcointalk.org/index.php?topic=5217699.msg53633870#msg53633870Edited 2020-11-30 to fix a broken image