<html>
<head>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.js"></script>
<link href="https://cdn.datatables.net/buttons/1.5.1/css/buttons.dataTables.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.colVis.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<meta charset=utf-8 />
<title>DataTables - JS Bin</title>
</head>
<body>
<div class="container">
<!-- <button id="unhide">Unhide</button> -->
<table id="example" class="display nowrap" width="100%">
<thead>
<tr class=''>
<th class='text-center', rowspan="2">Location</th>
<th class='text-center', rowspan="2">Drawing ID</th>
<th class='text-center', colspan="2">Original Schedule Date 28-Feb-22</th>
<th class='text-center', colspan="2">Updated Schedule Date 07-Mar-22</th>
</tr>
<tr class=''>
<th class='text-center'>Start</th>
<th class='text-center'>Finish</th>
<th class='text-center'>Start</th>
<th class='text-center'>Finish</th>
</tr>
<tbody>
<tr>
<td>Avenue</td>
<td>ESC01</td>
<td>25 Jan 2022</td>
<td>10 Aug 2022</td>
<td>25 Jan 2022</td>
<td>10 Aug 2022</td>
</tr>
<tr>
<td>Avenue</td>
<td>ESC02</td>
<td>25 May 2022</td>
<td>05 Sep 2022</td>
<td>01 Jun 2022</td>
<td>12 Sep 2022</td>
</tr>
<tr>
<td>Eglinton</td>
<td>ESC01</td>
<td>14 March 2022</td>
<td>21 July 2022</td>
<td>09 March 2022</td>
<td>18 Jul 2022</td>
</tr>
<tr>
<td>Eglinton</td>
<td>ESC02</td>
<td>28 Apr 2022</td>
<td>19 Aug 2022</td>
<td>03 May 2022</td>
<td>19 Aug 2022</td>
</tr>
<tr>
<td>Eglinton</td>
<td>ESC03</td>
<td>28 Apr 2022</td>
<td>19 Aug 2022</td>
<td>03 May 2022</td>
<td>19 Aug 2022</td>
</tr>
<tr>
<td>Science Center</td>
<td>ESC01</td>
<td>25 Jan 2022</td>
<td>25 Jan 2022</td>
<td>01 Mar 2022</td>
<td>10 Mar 2022</td>
</tr>
<tr>
<td>Science Center</td>
<td>ESC02</td>
<td>25 Jan 2022</td>
<td>25 Jan 2022</td>
<td>01 Mar 2022</td>
<td>10 Mar 2022</td>
</tr>
<tr>
<td>Oakwood</td>
<td>ESC01</td>
<td>31 Mar 2022</td>
<td>22 Jul 2022</td>
<td>31 Mar 2022</td>
<td>22 Jul 2022</td>
</tr>
<tr>
<td>Oakwood</td>
<td>ESC02</td>
<td>31 Mar 2022</td>
<td>22 Jul 2022</td>
<td>02 Apr 2022</td>
<td>22 Jul 2022</td>
</tr>
<tr>
<td>Oakwood</td>
<td>ESC03</td>
<td>31 Mar 2022</td>
<td>22 Jul 2022</td>
<td>31 Mar 2022</td>
<td>22 Jul 2022</td>
</tr>
</thead>
</tbody>
</table>
</div>
</body>
</html>
body {
font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #333;
background-color: #fff;
}
$(document).ready( function () {
var table = $('#example').DataTable({
columnDefs: [
//{targets: 0, visible:false},
{
targets: 4, className: "my-class"
}
],
"rowCallback": function( row, data ) {
if ( data[4] == data[2] ) {
$('td.my-class', row).css( 'background', 'yellow' );
}
if ( data[4] > data[2] ) {
$('td.my-class', row).css( 'background', 'Orange' );
}
if ( data[4] < data[2] ) {
$('td.my-class', row).css( 'background', 'Green' );
}
}
});
$('#unhide').on('click', function () {
table.columns().visible(true);
});
} );
You can jump to the latest bin by adding /latest
to your URL
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + [ | Indents selected lines |
ctrl + ] | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Clone Bin |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |