Why doesn't CSS ellipsis work in table cell?

Misha Moroshko picture Misha Moroshko · Apr 29, 2012 · Viewed 130.9k times · Source

Consider the following example: (live demo here)

The output is: width = 139, and the ellipsis doesn't appear.

What am I missing here?

Answer

Misha Moroshko picture Misha Moroshko · Apr 29, 2012

Apparently, adding:

td {
  display: block; /* or inline-block */
}

solves the problem as well.


Another possible solution is to set table-layout: fixed; for the table, and also set it's width. For example: http://jsfiddle.net/fd3Zx/5/