Truncate Long Text in Bootstrap 3 Table Rows Responsively



To truncate long texts inside rows of a table, use the following CSS −

.table td.demo {
   max-width: 177px;
}
.table td.demo span {
   overflow: hidden;
   text-overflow: ellipsis;
   display: inline-block;
   white-space: nowrap;
   max-width: 100%;
}

The following is the HTML −

<td class = "demo">
   <span>This is demo text and we have made it a long text for a demo.</span>
</td>
Updated on: 2020-03-04T06:42:40+05:30

916 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements