html - 怎么选择合适的标签?什么时候用<table>
高洛峰
高洛峰 2017-04-17 13:28:52
0
5
459

需要实现以下图的效果:

比较符合表格样式,但是对于table标签进行展开、收缩的开销不是很大吗?那这种情况应该使用什么标签比较好?
另外什么时候才需要用<table>标签呢?display:table和<table>的差异在哪里?小白求解答。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(5)
迷茫

Nest a sub-table or p, expand and hide it directly using css to control the display to none or block.

左手右手慢动作

CSS is compatible, but the table does not conform to semantics. It depends on what to do,

巴扎黑

Personally, I feel it is better to use ul li here
Display is table, which is not easy to use and quite troublesome. I just tried it. And this can easily mislead other developers, so it is not recommended to use it that way.

Peter_Zhu

After checking the information, I found that if it is a data-type table, you can use the table tag. If it is just to display the column style of the table, there is no need to use table. You can use display:table or display:flexbox to achieve it.

PHPzhong

From a semantic perspective, it is recommended to use table if the presentation form is a table. The
<table> tag defines an HTML table.
display: table; specifies the object as a table at the block element level, similar to the html tag <table>

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!