I have a table cell for which I would like to have the following effects:
width: 100px; white-space: nowrap; overflow: hidden;
In other words, a cell should always be a single line of text (its contents are guaranteed to contain plain text without HTML markup), it should be no more than 100 pixels, and if the text is longer, it must be cut off.
Unfortunately, when the text becomes long, the cell is still stretched. Tested in IE and FF, both of which relate to my target browsers.
The suggestion to add a <div> inside the cell and set the width for this is difficult. The table is created from the gridview control and simply adds the specified column width to the <td> element and inserts the text as is.
source share