3

In Chrome, I have a property of overflow-x: hidden on the td's of a table. When the cell's contents exceeds the cell, the rest of the contents are hidden. When I go to test this in IE11, the contents of the are hidden; however, there is a nasty vertical scrollbar that appears and I'm not sure why. Here is what it looks like:

enter image description here

If I uncheck that property in dev tools, then the vertical scrollbar goes away, however, the contents overflow into the row. Is there some way to resolve this?

1 Answers1

0

well since you want hide the cell's contents when this exceeds the cell space you should try text-overflow something like:

<table class="custom">
  <tr>
    <td>
      long long long long lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
    </td> 
        <td>
      long long long long lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
    </td> 
        <td>
      long long long long lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
    </td> 
  </tr>
    <tr>
    <td>
      long long long long lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
    </td> 
        <td>
      long long long long lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
    </td> 
        <td>
      long long long long lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng
    </td> 
  </tr>
</talble>

and the css:

.custom td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

reference