The following is an example of how this can be done:
Regarding the application of the following properties to an element, only one line of text will be displayed, and it does not resize:
white-space: nowrap;
overflow:hidden;
You can use below to display ellipses if any text is overflowing for visual purposes only:
text-overflow: ellipsis;
HTML
<div class='table'>
<div class='row'>
<div class='cell'>Something quite long</div>
<div class='cell'>here is some moreSomething quite long that should exceed the table cell.Something quite long that should exceed the table cell.</div>
</div>
</div>
CSS
.table {
margin:0;
padding:0;
display:table;
table-layout: fixed;
width:100%;
max-width:100%;
}
.row {
display:table-row;
}
.cell {
display:table-cell;
white-space: nowrap;
overflow:hidden;
text-overflow: ellipsis;
}
source
share