Tengo la siguiente DataTable que muestra datos de usuarios, una de sus columnas es la de correos:
Mi pregunta sencilla, como puedo colapsar o hacer que el texto se acomodo o se corte (lo que sirva) para que la columna no crezca, ya intente con codigo y nada:
DATATABLE
function DataTablesLoad() {
TablaNombreGet = $('#TablaClientes').DataTable({
lengthChange: false,
autoWidth: true, // must be true for responsive designs when scrolling is enabled
//, scrollY: 371 // comment out to remove fixed header
scrollCollapse: false,
columnsDefs: [
{
targets: 0,
render: function (data, type, row) {
return data.substr(0, 10);
}
},
],
dom: 'Bfrtip',
buttons: [
{ extend: 'copy', text: 'Copiar' },
{ extend: 'csv', text: 'CSV' },
{ extend: 'excel', text: 'Excel' },
{ extend: 'pdf', text: 'PDF' },
{ extend: 'print', text: 'Imprimir' },
//'copy', 'csv', 'excel', 'pdf', 'print'
],
language: {
"url": "//cdn.datatables.net/plug-ins/1.10.15/i18n/Spanish.json"
},
processing: true
});
};
TABLA HTML
<table id="TablaClientes" class="table table-bordered table-hover display nowrap margin-top-10 w-p100 grid" style="width:500px;">
<thead>
<tr>
<th>ID Cliente</th>
<th>Nombre Cliente</th>
<th>Dirección</th>
<th>Telefono</th>
<th>Usuario</th>
<th>Correo</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
@foreach (var m in Model)
{
<tr>
<td>@m.IdCliente</td>
<td>@m.Nombre_Cliente</td>
<td>@m.Direccion</td>
<td>@m.Telefono</td>
<td>@m.UserName</td>
<td>@m.CorreoCliente</td>
<td style="white-space: nowrap">
<button type="button" class="btn btn-success editarUsuario" data-id="@m.IdCliente" data-toggle="modal" data-target="#modal-editarUsuario">Editar</button>
<button type="button" class="btn btn-primary resetPassword">Reenviar contraseña</button>
</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<th>ID Cliente</th>
<th>Nombre Cliente</th>
<th>Dirección</th>
<th>Telefono</th>
<th>Usuario</th>
<th>Correo</th>
<th>Acciones</th>
</tr>
</tfoot>
</table>
table
la clasenowrap