I am fairly sure this is impossible with just html/css, but I wanted to ask just in case. Let's say I have <div>
inside a <td>
, the div has the overflow: hidden;
style. Instead of the overflow just being cut off, I want to:
Edit: I missed a critical detail when originally asking the question - is this possible to do with overflow-y, so I can still have multiple lines of text before it generates the "..."?
PLNKR for testing
Select the cells you want to prevent from overflowing. On the Home tab, in the Alignment group, click the Dialog launcher (a small arrow in the lower-right corner of a group). On the Alignment tab of the Format Cells dialog box, choose Fill in the Horizontal drop-down list.
All you can do is, right click that cell, choose Format cell, then in the text section, set text to wrap and set the cell height to automatic . . . Power to the Developer!
Display default value based on another cell with VLOOKUP In Excel, you can use the VLOOKUP function to quickly show value based on the corresponding value. D1 is the value you look up based on, A1:B7 is the data range you look for, 2 indicates to find the value in second column of the looking for range.
Example taken from the link I provided in the OP comments:
.element-to-cut-off {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
From your plnkr, change div class to this:
div{
background-color:cyan;
width: 80px;
height: 40px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
Change your plnkr to this for multi line:
div{
background-color:cyan;
width: 80px;
height: 40px;
overflow: hidden;
-webkit-line-clamp: 2; // number of lines before ellipsis kicks in
-webkit-box-orient: vertical;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
}
I will stress I don't know which browsers can use this css3 and don't have time to test all, but works fine in Chrome 46
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With