A basic search datatable not working
A basic search datatable not working
Saab93
Posts: 2Questions: 1Answers: 0
in SearchPanes
Now i have spent a weekend to get this working, but not. It's just a basic thing! No search box, nothing, just the table is showing. My code is:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test </title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css"></link>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/select/1.3.3/js/dataTables.select.min.js"></script></script>
<script>
$(document).ready(function() {
$('#TableId').DataTable( {
select: true
} );
} );
</script>
</head>
<body>
<p> </p>
<p> </p>
<table border="1" class="display" id="TableId" style="width:100%">
<thead>
<tr>
<th>Nuvarandemålgrupp</th>
<th>Nuvarandemåltyp</th>
<th>Nytt Prefix</th>
<th>Målgrupps nummer</th>
<th>Målgruppsnamn</th>
<th>Måltyps nummer</th>
<th>Måltypsnamn</th>
<th>Beskrivning</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="3" width="152">10 Tvistemål</td>
<td width="203">1052 Diskrimineringsmål</td>
<td width="64">T</td>
<td width="103">100<br></td>
<td width="126">Tvistemål<br>
<br></td>
<td width="120">11</td>
<td width="202">Diskriminering</td>
<td width="449">Tvister enligt diskrimineringslagen (2008:567) i den mån det inte rör sig om arbetstvist.</td>
</tr>
<tr>
<td width="203">1038 Klander av skiljedom</td>
<td width="64">T</td>
<td width="103">100<br></td>
<td width="126">Tvistemål<br>
<br></td>
<td width="120">12</td>
<td width="202">Mål enligt lagen (1999:116) om skiljeförfarande </td>
<td width="449">Mål enligt lagen (1999:116) om skiljeförfarande.</td>
</tr>
<tr>
<td width="203">1099 Övriga tvistemål</td>
<td width="64">T</td>
<td width="103">100<br></td>
<td width="126">Tvistemål<br>
<br></td>
<td width="120">13</td>
<td width="202">Övriga tvistemål</td>
<td width="449">Övrigt som inte passar in i övriga måltyper. </td>
</tr>
<tr>
<td width="152">14 Grupptalan</td>
<td width="203">1410 Enskild grupptalan<br>
1411 Organisationstalan<br>
1412 Offentlig grupptalan</td>
<td width="64">T</td>
<td width="103">100</td>
<td width="126">Tvistemål</td>
<td width="120">14</td>
<td width="202">Grupptalan</td>
<td width="449">Mål som handläggs enligt lagen (2002:599) om grupprättegång.</td>
</tr>
<tr>
<td width="152">10 Tvistemål</td>
<td width="203">1011 Näringslivstvist</td>
<td width="64"> </td>
<td width="103"> </td>
<td width="126"> </td>
<td width="120"> </td>
<td width="202" id="Utgår">KODEN UTGÅR</td>
<td width="449">Rör inte saken utan part. Mål som lades i denna kod kan nu istället sorteras in under koderna avseende sak ovan. Part framgår av Vera. </td>
</tr>
</tbody>
</table>
</body>
</html>
Answers
"rowspan" in a tbody is not supported by DataTables.
Thank u!
And HOW should i know that??? (not your fault!)
I deleted the rowspan and tested again. Still the same!
The HTML requirements doc explains what is supported by Datatables.
The place to start is by looking for errors in the browser's console. It looks like you have defined 8 columns in the
thead
but some of the rows have only 7 columns. They need to match.If you still need help please provide a link to your page or a test case showing the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin