I'm trying to get something similar to the following code:
<div class="window-width-container">
<div class="head">head</div>
<div class="tail">(tail)</div>
<div class="head">head head head head head</div>
<div class="tail">(tail)</div>
<div class="head">head head head head head head head head head head head head head head head head head head head head head head head head </div>
<div class="tail">(tail)</div>
</div>
To output:
+------------------------------------+
+head(tail) +
+head head head head head(tail) +
+head head head head head he...(tail)+
+------------------------------------+
Where the following constraints are in place:
The head div has inline-block behavior (i.e. the width is flexible to the content)
The tail div follows immediately after
Both divs fit in one line, with head being ellipsized if it gets too large
I can almost get the behavior working if I use tables instead of divs, but once I use
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
to get that ellipsis behavior, it insteads does overflow and pushes past the bounds of the container div.
Any help would be greatly appreciated!