Earlier quoted context omitted.
InsertRow updates the live DOM and React just wholesale replaces it. It’s a masterstroke footgun.
Yes, your point? Anyone who spend 15 minutes learning about React learns that you don't manipulate the DOM directly, you let the rendering engine handle that for you.
Do you know that there is an HTML tables API?
141–150 of 206 posts
Re: Do you know that there is an HTML tables API?
#142Earlier quoted context omitted.
I figured that was the normal way to interact with tables, what would people do otherwise?
Using the standard DOM APIs or - if they don't care about anything - innerHTML, I suppose.
Re: Do you know that there is an HTML tables API?
#143Phew, this post single handedly made me feel old this morning. I started dabbling with the web just over 20 years ago but have mainly been working on the backend the past 10-15 years. I had no clue that nowadays programmers don’t know about this, so I assume it’s supplanted by modern frameworks or modern JS/CSS
I’ve been building sites since around 2000 and I’ve used HTML tables a lot (including for page layouts, remember those days?). There was a time when I thought I was fluent enough to not have to look up HTML or CSS docs for most things. But I don’t think I’ve ever actively used the DOM API that this article mentions so I learned something new today.
If was much simpler to build tables in javascript with this rather than using document.createElement.
Perhaps this was one of those things that you just had to know about, or be working on data heavy web apps.
Re: Do you know that there is an HTML tables API?
#144Re: Do you know that there is an HTML tables API?
#145Earlier quoted context omitted.
It's about the insertRow() and insertCell() methods and rows[] and cells[] fields on the table element, not the table itself.
I figured that was the normal way to interact with tables, what would people do otherwise?
Re: Do you know that there is an HTML tables API?
#146Earlier quoted context omitted.
Yes, your point? Anyone who spend 15 minutes learning about React learns that you don't manipulate the DOM directly, you let the rendering engine handle that for you.
Yes that’s why of instead of learning the standard apis, you have to spend 15 months learning how to debug useEffect
Re: Do you know that there is an HTML tables API?
#147Earlier quoted context omitted.
Using the standard DOM APIs or - if they don't care about anything - innerHTML, I suppose.
Sorry I - also - am one of those old timers who don't understand this because the shown code is all I've ever used for creating table. So, what is this "standard DOM API" if I may ask? Could you post a code example?
Re: Do you know that there is an HTML tables API?
#148Earlier quoted context omitted.
You knew about the .insertRow() and .insertCell() methods?
I made my first CRUD UI that didn't do full page refreshes with those methods.
Re: Do you know that there is an HTML tables API?
#149Phew, this post single handedly made me feel old this morning. I started dabbling with the web just over 20 years ago but have mainly been working on the backend the past 10-15 years. I had no clue that nowadays programmers don’t know about this, so I assume it’s supplanted by modern frameworks or modern JS/CSS
HTML tables are cognitively if not officially deprecated these days. I made my 1996 resume in HTML using a table for layout and it was indistinguishable from the Word version when printed. Made by editing the HTML by hand too! Tables are great. I don't doubt that CSS stuff is more capable, but the old ones are still useful.
According to who?
Re: Do you know that there is an HTML tables API?
#150Woah, it’s always weird to see how there’s modern web engineers that didn’t grow up during the era where entire layouts were built on tables. Not saying that it was good or bad, but just interesting.