CSS nth-child for greater than and less than

前端 未结 6 1523
萌比男神i
萌比男神i 2021-01-31 13:24

In my HTML I have,

6条回答
  •  -上瘾入骨i
    2021-01-31 14:07

    For those after a dynamic solution (if you don't want to hard-code the column widths etc), I've published a javascript solution, based on this excellent answer.

    Working example

    Usage:

    // After including tableColumnFreeze.js
    var freezer = document.getElementById('freezer');
    new TableColumnFreeze(freezer);
    

    Markup:

    Column 1Column 2Column 3
    FrozenNot frozenNot frozen
    FrozenNot frozenNot frozen
    FrozenNot frozenNot frozen
    FrozenNot frozenNot frozen

提交回复
热议问题