JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Select2 + DataTables</title>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/css/jquery.dataTables.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/css/select2.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.3.0/css/responsive.dataTables.min.css">
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.3.0/js/dataTables.responsive.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.min.js"></script>
<script>
$(document).ready(function () {
$('#TestTable').dataTable({
pageLength: 5,
responsive:true,
ordering: false,
drawCallback: function(dt) {
console.log("draw() callback; initializing Select2's.");
$('.experience-jquerySelect2-tag').select2({tags: true, width: "10em"});
}
});
});
</script>
</head>
<body>
<table class="table-sm table-striped table-condensed" id="TestTable">
<thead>
<tr class="small">
<th scope="col">Drop Down1</th>
<th scope="col">Drop Down2</th>
<th scope="col">Drop Down3</th>
<th scope="col">Drop Down4</th>
<th scope="col">Drop Down5</th>
</tr>
</thead>
<tbody>
<tr>
<td>cell1-1</td>
<td>cell1-2</td>
<td>cell1-3</td>
<td>cell1-4</td>
<td valign="middle" align="left" class="small text-nowrap">
<span class="form-group">
<select...