JSFiddle - React, Tailwind, and code Playground

by bjelline

HTML

<br />
<br />

<ul>
    <li class="fixed">Fixed Size</li>
    <li>
        <div>
            <span>this text is very very long and it goes on and on and on and on but does not wrap</span>
        </div>
    </li>
    <li><div>
            <span>short</span>
        </div></li>
    <li><div>
            <span>one more tab</span>
        </div></li>
    <li><div>
            <span>another tab</span>
        </div></li>
</ul>

CSS

ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: table;
    border-spacing: 6px 0px;
}

li {
    display: table-cell;
    background-color: red;
    min-width: 10px;
    width: 100px;
}

li > div {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 20px;
}

li > div > span {
    position: absolute;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 20px;
}

li.fixed {
    width: 100px;
    min-width: 100px;
    text-align: center;
}