How to add triangle in table cell

前端 未结 3 848
轻奢々
轻奢々 2020-12-15 23:42

I need to add up-right triangle in a cell.

\"enter

How to do this?

I t

3条回答
  •  渐次进展
    2020-12-16 00:03

    Found this question through Google and ran into issues, so I'll add this here despite the age of original post.

    Madara's answer works in most browsers, and works anywhere outside of a table in all browsers. But as mentioned in the comments, the example doesn't work in Firefox.

    There's a very old ticket in Bugzilla concerning position:absolute; not working in elements.

    The main solution is to add an inner

    :

    HTML:

    Triangle!
    No Triangle!

    CSS:

    td .note {
        padding: 20px;
    }
    

    jsFiddle example

    I did find that it was possible to achieve without an inner

    but only when the was empty, which probably doesn't help.

提交回复
热议问题