A Case Study of Complex Table Design
jlongster.com
jlongster.com
[1]: https://practicaltypography.com/alternate-figures.html#tabul...
I suppose the real benefit is having a font available across all platforms. Inter appears to be a high quality typeface, and I appreciate its author for releasing it under an open license. [1] [2]
Anyone have good tips for this?
I think tables just don't sit well in HTML. We are trying to force a 2D structure where useful operations might be based on either dimension into a flattened hierarchical structure where one dimension must take priority, and that is awkward. The attempt to work around this by introducing colgroup and col elements never really went anywhere either.
So for now, we resort to tricks like artificial DOM structures and pretend margins/padding and manual positioning, the same kind of hackery that we used to use for page layouts until tools like flexbox and grid were introduced. What we really need, IMHO, is a similarly comprehensive set of dedicated table selectors and styling options in CSS. There have been proposals like the nth-col pseudo-class and the || column combinator, which look like useful ideas, but again these haven't really gone anywhere so far. There might be some value in allowing tables to be styled as row-major or column-major (a similar idea to flex-direction) and then basing other styling around the major and minor axes rather than relying on rows/children and columns specifically.
A common solution, which qualifies as “janky”, is to render sticky rows in a <div> element, completely separate from the <table> itself. If I remember correctly, DataTables [1] takes this approach for its sticky headers. React Table [2] takes a similar approach, and actually abandons <table> altogether by using <div> elements for table body, rows, and cells.
[1]: https://www.datatables.net
[2]: https://react-table.js.org
I haven’t seen many solutions for sticky columns, but the least bad solution might also be a “janky” separate <div>.
So if it's performant, it's not "janky" (again, in web-dev circles) but it could still be a "hacky" implementation, even without any jank. It's also different from "robust", so something can be not-janky but also not-robust.
It’s not ideal, but this works on about 95% of all browsers.
In my mind the bigger issue is being able to cancel or merge transitions if scrolling quickly. Otherwise you end up like excel's animated cursor which literally is slower now than before it was animated. Nobody likes scrolling through molasses
I know it's probably petty of me, but I would disagree: I expect the contents of a table to be placed within <table>.
Also define backups!
I've never usually thought writing a blog about making tables would be a good idea