Hacker News new | ask | show | jobs
by rchaud 1512 days ago
How likely is it that a dev would be reading an HTML table with hardcoded data in the code editor in this day and age?

Today, data tables are mostly dynamically generated, probably via accessing an API endpoint of some sort. The dev would at most write a function that would output the data inside a <table> element. But the table data itself would only be visible in the browser, it wouldn't be hardcoded into the HTML markup.

2 comments

If you're following the advice of the post, and using HTML as your authoring format, this is pretty common. I do it a lot on my blog.

It's similar to how often you see tables in Markdown.

Even the official Markdown guide suggests using a table generator because the markup is a hassle:

https://www.markdownguide.org/extended-syntax/

HTML tables are similarly cumbersome, with or without closing tags. If you have a table of static information to fill in, copy/pasting from Excel into a HTML table generator and pasting the output is signficantly faster.

Markdown is suggesting using a generator for writing, but you were saying it was unlikely that someone would be reading a table in source.

I'd also much rather write an HTML table by hand than a markdown one.

What is your point? Even if it is a rare occurrence, from time to time you might want to output an html table using "print", and it will be slightly more comfortable that way. I sometimes find myself editing html by hand. Thanks to the optional and auto-closing tags it is just as easy as markdown, and you don't need an extra conversion step.

The verbose format has no advantage whatsoever, unless you are doing weird xml stuff.