responsive DataTables
with too long strings on 2nd site
HTML
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.dataTables.min.css">
<script src="https://cdn.datatables.net/responsive/2.1.1/js/dataTables.responsive.min.js"></script>
<table width="100%" class="table table-striped table-bordered dataTable dt-tarif">
<thead>
<tr>
<th class="no-sort center-th">Auswahl</th>
<th>Versicherer</th>
<th>Tarif</th>
<th>Bewertung</th>
<th>Beitrag</th>
<th>Optionen</th>
</tr>
</thead>
<tfoot>
<tr>
<th class="center-th">Auswahl</th>
<th>Versicherer</th>
<th>Tarif</th>
<th>Bewertung</th>
<th>Beitrag</th>
<th>Optionen</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><input type="checkbox"></td>
<td>Condor Privatschutz</td>
<td>A-Tarif</td>
<td data-order="2">
<i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star-o"></i><i class="icon-star-o"></i><i class="icon-star-o"></i><i class="icon-star-o"></i></td>
<td>11,56€ fdsa fdsafdas das dafsf dasf dsa dfsa fsa fdsa fdsaf sadf dsa fdsa fdas fas fdasf as fasd fasd fsa fads fas fasd fadsf ds fsa fsad fas fsadf sda</td>
<td><button class="button button-3d button-small bg-grey">Antrag drucken</button></td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td>Europa Versicherung AG</td>
<td>B-Tarif</td>
<td data-order="4">
<i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star-o"></i><i...
JavaScript
$('table.dt-tarif').dataTable({
"paging": true,
"info": false,
"searching": false,
responsive: true,
"order": [[0, "asc"]],
"aoColumnDefs": [
{
"bSortable": false,
"aTargets": [0,5]
},
{
"type": "currency", targets: 4
}
],
"language": {
"lengthMenu": "Zeige _MENU_",
"zeroRecords": "Keine Entwürfe vorhanden!",
"info": "Seite _PAGE_ von _PAGES_",
"infoEmpty": "Es konnte kein Entwurf gefunden werden.",
"infoFiltered": "",
"search": " ",
"paginate": {
"first": "Erste",
"last": "Letzte",
"next": "Vor",
"previous": "Zurück"
},
}
});
$('table.dt-tarif input[type=checkbox]').change(function(e){
if ($('input[type=checkbox]:checked').length > 3) {
$(this).prop('checked', false)
$('.errormodal').modal('show');
}
});