How to add border radius on table row

前端 未结 11 1871
南方客
南方客 2020-12-02 06:14

Does anyone know how to style tr as we like?

I\'ve used border-collapse on table, after that tr\'s can display 1px solid border I give them.

However, when I\

11条回答
  •  囚心锁ツ
    2020-12-02 06:52

    I think collapsing your borders is the wrong thing to do in this case. Collapsing them basically means that the border between two neighboring cells becomes shared. This means it's unclear as to which direction it should curve given a radius.

    Instead, you can give a border radius to the two lefthand corners of the first TD and the two righthand corners of the last one. You can use first-child and last-child selectors as suggested by theazureshadow, but these may be poorly supported by older versions of IE. It might be easier to just define classes, such as .first-column and .last-column to serve this purpose.

提交回复
热议问题