Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know why HTML tables can't natively support a lot of common table functionality? Lazy rendering, fixed column headers, sorting and so on? Are there any proposals to add all this natively?



I think a bit part of HTMLs success is not being too opinionated about more advanced/specific UI components. Think of it more of as a low level GUI toolkit constructor, one to builg actual GUI toolkit on top of, for example material-ui and bootstrap.


That doesn't really answer the question though.

It's up to the browser implementers how they do tables, and they certainly could go ahead and cater to common cases in this area. As user agents, it's the browsers' job to be helpful to the user regardless of what the HTML looks like.

For example, nothing in HTML talks about having a search prompt appear on Ctrl+F, yet everyone does it.


HTML does not have a table component because it is a markup language, and that kind of interactivity (sorting, filtering, pagination etc) is really beyond its scope. The exception to this are basic user input fields (buttons, check-boxes etc).

This is by design, browser vendors are focused on implementing low level APIs and functionality, leaving the higher level component development stuff up-to web developers and designers.

Use a combination of JS, CSS and HTML to create advanced components from scratch, or use one of the thousands of open-source libraries available. The library linked to in this post is a good example of that.

> It's up to the browser implementers how they do tables, and they certainly could go ahead and cater to common cases in this area.

They already have, via the <table> tag (https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/A...).


True. But especially lazy rendering and fixed column headers seem to be within HTML's remit. Fixed column headers should probably be a new CSS rule, and lazy rendering should just work by default.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: