Table tbody scroll in IE8

后端 未结 1 828
别跟我提以往
别跟我提以往 2020-11-28 13:03

In my project, I am trying to make the tbody scroll in IE8. I know it can be scrolled by just giving overflow: auto to tbody. But this

相关标签:
1条回答
  • 2020-11-28 13:30

    I found two ways to solve this problem in IE8.

           1)   Adding extra td element of width: 0px to tr's of thead and tbody.

    IE8 demo

           2)   Adding a hidden letter to content of after pseudo selector.

        tr:after{
            content: ".";
            visibility: hidden;
        }
    

    I added the above in conditional css. because the problem was only in IE8. (I haven't tested in IE9+)

        <!--[if IE 8]>
             <style>
                 /* the above css code here */
             </style>
        <![endif]--> 
    

    IE8 demo

    I used the latter one because it is simple.

    0 讨论(0)
提交回复
热议问题