Yet Another Divs vs Tables issue: Forms

后端 未结 5 865
我寻月下人不归
我寻月下人不归 2020-12-01 18:51

[Meta-note:] I was browsing the question page, getting really tired of \"DIVS vs Tables\" \"When to use tables vs DIVS\" \"Are Divs better than Tables\" \"Tables versus CSS\

5条回答
  •  粉色の甜心
    2020-12-01 19:15

    The trick is when the form gets more complicated than your sample, you realize that tables enable a "flexible grid" that no other elements do.

    e.g. what if the "input" is more complicated than a text box? e.g. a bunch of radio buttons, each with their own label:

    Color: [____Red___][v]
     Hood: [*] 
     Size: (_) Small
           (_) Medium
           (_) Large
           (*) X-Large
    

    If all you need are simple forms, CSS is great, but as soon as you need a grid, things get interesting...

    If you really want to do this, I would check out The Man In Blue's Solution, it works pretty well and is very clean.

提交回复
热议问题