Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

Truncating text into ellipsis in a fluid div inside table-cell

$
0
0

I have a 3 column fix left and right layout, with middle layout as fluid as below. It works perfectly as currently. However, if i add a truncate class to it, the middle div width will expand over the parent width.

So, my question is: How to truncate text in fluid layout and fix the truncated text inside the fluid layout width. Do note that I do not expect to hard code the middle div width.

Plunkr before adding truncate class: Click here

If replace div class=middle into this, it will fail to truncate text.

<div class="middle">
        <div class="truncate">This is a very long text that should be truncate</div>
        <div class="truncate">This is a verry very long text that should be truncated</div>
      </div>

Sample expected:

enter image description here


Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>