What is this I hear about the table tag being depr

2019-02-16 14:51发布

问题:

Because that might mess me up, somewhat. I'm not entirely clear on what I'm supposed to use to replicate some of its functionality effectively, should I adopt a newer standard down the road.

I can't seem to find good information sources to verify this, though. Would there be a good reason for this?

回答1:

table tag isn't deprecated (you can look at the html spec). What you've heard of is probably tableless layouts, because tables should not be used for positioning elements on the page.



回答2:

The <table> tag is most certainly not deprecated. The thing is, you must (well, should) only use it for tabular data. It was and sometimes still is being abused for layout purposes, which is extremely bad practice for a variety of reasons, and CSS is the preferred technology to use there.



回答3:

I haven't heard this. I feel I would have with my recent stretch of web conferences.

I will say tables should not be used for layout, strictly tabular data. It's the new semantic web. Maybe that's what you heard.



回答4:

It is definitely not being depreciated. I also thought I heard this, however, it was simply a statement implying that the table tag is not as effective as the div tag in terms of layouts as table columns do not drop down when the screen size is reduced.

One thing that I am very concerned about, is that we are yet to have a similar html element that can act as a table, but collapse down like a div in smaller screens without any css. This would really save time as the only thing one would need to declare is the width of each column, and not have to write too much css for column positioning (blocks, inline-block etc).