Lurker News

Comments (132) 38 threads

Earlier comments
Eduard#
I'd say the claim "works everywhere" does not consider small screens. I had a look at the examples with Android Chrome in portrait viewport, and cell content gets either cut off with ellipses on overflow, or breaks long words such as email addresses unintelligibly over several lines.

In my opinion, scrollable-by-touch tables such as Bootstrap 's "responsive tables" fix these issues. Add "scroll for more" shadows for even better UX.

rootcage1 reply#
Out of curiosity how is this better than current Grid/Table implementations?
whycombagator#
Unsure what differs between the two functionally, but it appears that library is ~3x the size for js+css (~12kb vs ~30kb) compared to Grid.js. It looks like it might use jQuery too? Or at least, the CDN is "jquery.dataTables.min.js"
joaodlf2 replies#
datatables uses jquery, though.
boromi#
Yep, it's got more functionality at this point. I wonder if the author of Grid.js could incorporate the added functionality.
ies71 reply#
From user point of view, datatables can do much more than Grid.js
werdnapk#
I've found datatables to be my only real solution when dealing with lots of server side data. It has it's quirks for sure, but there really isn't anything I haven't been able to accomplish with it so far (although making it do what you want sometimes can involve some head scratching).

Edit: I see http://www.tabulator.info/ mentioned in the comments. This looks pretty full featured... time to do some research.

triceratops1 reply#
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?
orange82 replies#
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.
Zecc1 reply#
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.

orange8#
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 tag (https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/A...).

triceratops#
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.

Load more comments