I want to truncate some long text into a single line in bootstrap 4, I have read many solutions here such as Link 1, Link 2, Link 3 but they were not helpful.
The text I have:
This is how I want it to look:
But this happened with the code as shown below, the table line protrudes outwards a bit, and the text is not in a single line.
Here is my code:
<div class="row">
<div class="font-14">
<table id="userLogTable" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">LOG LIST</th>
<th class="text-center">DETAIL</th>
</tr>
</thead>
</table>
</div>
</div>
columns: [
{ data : "id", "className": "text-center" },
{ data : "log_info", "className": "text-log" },
{ data : "log_id", "className": "text-center",
render: function(data) {
return "...";
}
}
],
.text-log {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1; /* number of lines to show */
-webkit-box-orient: vertical;
}