How to style my unordered list like a table?

后端 未结 3 456
余生分开走
余生分开走 2021-01-05 04:19

I have ONLY one

    and under that we have group of
  •  
    • 1
    • 2
3条回答
  •  暖寄归人
    2021-01-05 04:34

    You cannot convert a single list (containing more than 2 items) into 2 columns via the display: table properties because you need some element to act as the table-row. Without an element acting as a table-row, all adjacent elements that are set to display: table-cell will be contained within an anonymous table-row element that cannot be modified or styled in any way.

    Your only option is to either change the markup (to use tables or lists of lists) or use a different approach to your CSS: either floats/inline-block on the lis or using the columns property on the ul.

提交回复
热议问题