> But if you render server side (as with PHP), you'd likely just build up your table on the server rather than dynamically on the client, so you would also not use these imperative table element specific APIs.
The question was: What do people use now to create HTML tables instead of the table manipulation API described in this blog post.
I said:
- If you render a table on the client (not what JS was originally built for, but what it is often used for now) using a framework like React, you declaratively render the table using its semantic elements (table, thead, tbody, tr, td etc.) instead of imperatively building it up using that API
- If you render a table on the server, you essentially do the same (output the table markup)
That's why I described the above mentioned table API as "niche", which you seem to have taken offense with but I still have no idea why.
Maybe you're suggesting that this API is commonly used to add interactivity to a table element on a page with JS? I could see it being used for that, no idea if it is, I still have the feeling that just using regular Element APIs is more common - the question was also about creating tables specifically, not manipulating them, so that's why I mentioned declarative frontend frameworks.
A website can be fully rendered on the server at load time and still being interactive on the client side after that initial load.
In that situation, if you want to interactively create a table on your webpage, then you can either use generic DOM methods (which I suspect is the most common way), or you can use the dedicated API.
That's how we did websites back in the 2000s and that's still how most of them are made in practice because the “legacy” tech never went away even if it has minimal visibility on tech forums like HN.