Skip to content

[css] 第111天 你有用过table布局吗?说说你的感受 #1026

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第111天 你有用过table布局吗?说说你的感受

Activity

xiangshuo1992

xiangshuo1992 commented on Aug 5, 2019

@xiangshuo1992
Contributor

用来做列表排版还是很不错的,但是要想用的好,还是要对table有比较多的了解。
比如实现表头固定,表内容超出滚动的效果等

nowherebutup

nowherebutup commented on Aug 5, 2019

@nowherebutup

有时候写demo,不想引入UI组件库时,使用原生的,
不过实际开发的工作中,都是 用现成的UI组件库,
总体来说还是用现成的比较方便

AnsonZnl

AnsonZnl commented on Aug 6, 2019

@AnsonZnl
Contributor

最近再用,感觉还不错哈哈

Konata9

Konata9 commented on Aug 19, 2019

@Konata9

div + css 布局成为主流之前,基本都是以 table 布局为主。曾经的三剑客,Dreamever 的所见即所得也是利用 table 来做布局。

table 布局对于排版比较友好,水平居中、垂直居中都可以利用 table 的属性来完成。但缺点也是十分明显的。

  • table 布局往往是 table 嵌套 table,会有非常多的 DOM 节点,对于性能来说是一个灾难
  • 语义化不明,本身就是标签错误的用法。因此对 SEO 不友好。
  • DOM 操作是噩梦,无数的 trtd 中要寻找到目标 DOM 元素非常困难,代码没有维护性可言。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@Konata9@xiangshuo1992@AnsonZnl@nowherebutup

        Issue actions

          [css] 第111天 你有用过table布局吗?说说你的感受 · Issue #1026 · haizlin/fe-interview