JSFiddle - React, Tailwind, and code Playground

by joshmoto

HTML

<table style="width:100%;">
  <tr>
    <td>
      <div class="parent-div">
        <div class="text-div">This is text I'd like to truncate when space doesn't permit. >This is text I'd like to truncate when space doesn't permit. >This is text I'd like to truncate when space doesn't permit. >This is text I'd like to truncate when space doesn't permit</div>
      </div>
    </td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
</table>

CSS

.parent-div {
    display: -webkit-flex;
    display: -moz-flex;
    display: flex;
}

.text-div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;    
    
    min-width: 0;
}

.icon-div {
    -webkit-flex: 1;
    -moz-flex: 1;
    flex: 1;
}