0

FF v14 has the look I am seeking. IE9 does not hide overflow nor does it show the ellipsis. How can I fix this to work in IE9?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
    <style type="text/css">
    .col
    {
        max-width:10em;overflow:hidden;text-overflow:ellipsis;
    }
    .row
    {

    }
    .table
    {
        white-space: nowrap;
    }
    </style>
</head>
<body>
<table class="table">
    <tr class="row">
        <td class="col">This is some text in row 1 column 1</td>
        <td class="col">This is what it looks like in row 1 column 2</td>
    </tr>
    <tr class="row">
        <td class="col">here is row 2 column 2</td>
    </tr>
</table>
</body>
</html>

UPDATE
I noticed a validation error in visual studio:

Validation (CSS 2.1): 'text-overflow' is not a known CSS property name.

Does this mean I need to somehow explicitly specify a higher version of CSS? If yes, how?

Fiddle

4

1 回答 1

2

The only solution that I think of is to wrap the contents of the cells in DIVs:

        <td><div class="col">This is some text in row 1 column 1</div></td>

A bit messy, but it does seem to work in IE, Chrome, FF and Safari.

于 2012-08-06T16:02:45.577 回答