Last active
August 27, 2024 08:55
-
-
Save FFKL/9018d68ac764d01817221145a6d09a21 to your computer and use it in GitHub Desktop.
Auto-resizable ellipsis without fixed width 😮
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ellipsis { | |
position: relative; | |
} | |
.ellipsis:before { | |
content: ' '; | |
visibility: hidden; | |
} | |
.ellipsis span { | |
position: absolute; | |
left: 0; | |
right: 0; | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<td> | |
<div class="ellipsis"> | |
<span>Very very long text for this cell</span> | |
</div> | |
</td> |
Thanks, great workaround, works as expected!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!