Can we have multiple in same ?
前端 未结 8 1468
攒了一身酷
攒了一身酷 2020-11-22 05:57

Can we have multiple

tags in same
? If yes then in what scenarios should we use multiple tags
8条回答
  •  伪装坚强ぢ
    2020-11-22 06:39

    Yes you can use them, for example I use them to more easily style groups of data, like this:

    thead th { width: 100px; border-bottom: solid 1px #ffffd; font-weight: bold; }
    tbody:nth-child(odd) { background: #f5f5f5;  border: solid 1px #ffffd; }
    tbody:nth-child(even) { background: #e5e5e5;  border: solid 1px #ffffd; }
CustomerOrderMonth
Customer 1#1January
Customer 1#2April
Customer 1#3March
Customer 2#1January
Customer 2#2April
Customer 2#3March
Customer 3#1January
Customer 3#2April
Customer 3#3March

You can view an example here. It'll only work in newer browsers, but that's what I'm supporting in my current application, you can use the grouping for JavaScript etc. The main thing is it's a convenient way to visually group the rows to make the data much more readable. There are other uses of course, but as far as applicable examples, this one is the most common one for me.

提交回复
热议问题