A problem with the grid in the output in output-mode="html" (sqlite)
Closed this issue · 4 comments
When using output-mode="html"
and then for example adding <a>
content into the output rows, the header row will expand to the size based on characters in the rows in the output, while the output rows won't expand obviously, for example if in the output row there is string <a href="https://example.com">This is a link</a>
it appears in the row with only text This is a link
while the header row thinks the row has much more characters (everything in that <a href.....></a>
) and so expands and breaks the the grid not aligning properly.
Is there anything I can do to avoid this problem?
Below is an example. (Note I renamed the first column's header name because of this problem. It should only read user
.)
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────────────┬───────┬────────┬─────┬─────┬─────┬────────┬─────────┬────────┬─────────┐
│ user___participations___wc1_to_wc9_rankings │ participation_count │ wc1 │ wc2 │ wc3 │ wc4 │ wc5 │ wc6 │ wc7 │ wc8 │ wc9 │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────────────────┼───────┼────────┼─────┼─────┼─────┼────────┼─────────┼────────┼─────────┤
│ wazsi │ 11 │ - │ - │ - │ - │ - │ - │ - │ - │ 140/200 │
│ WC4ends │ 1 │ - │ - │ - │ - │ - │ - │ - │ - │ - │
Judging from the description, it's entirely a matter of the HTML fragment you return and the CSS styles you use. Not the widget.
If you think I'm wrong, please provide a working example to reproduce the problem.
I wanted to make a simple web UI for certain sqlite db. It kinda became too big with crazy queries formed by chatgpt but I don't want to spend more time on the project. This URL below should work at least for couple hours from now if you can check. The "Cups", "Events" and those Users index links have anchors embedded in the output rows and it's those were the grid breaks. It could be hard to make sense of that because it has so much content being generated with long queries. No CSS is in use but I thought that it's not related to this problem.
But yeah not related to this problem but also I guess if I wanted to wrap the content on some of those rows that expand so much causing horizontal scrolling, I guess I could try do it but when I looked at the iframe output option I wasn't sure if that should do it. I guess it would be nice to make it look pretty but my competence may have hit the limit.
I see. You are running SQL queries against SQLite and displaying the result. SQLite does not return an HTML table, it returns a plain text formatted table. So if the database fields contain HTML fragments, I believe they can "break" the formatting.
This is not related to the widget, it's just how HTML works. I won't be able to help you with this, sorry.
I see. Thanks for explaining so I don't waste my time trying to figure out if I could solve it in here. It's fine however. It doesn't matter if it breaks, as this is just a temporary "home" for viewing this data until the data is migrated to another place. It's still a good viewer as it is now so Codapi has been a good temp home here.