'I can't run DataTable in VSCode
I'm having some errors using a table using DataTable in Visual Studio Code.
The errors have been commented out in the code for clarity on each line where they result.
I state that I have not installed any extensions in VSCode. Is this possibly necessary to use DataTable and Bootstrap?
On codepen or on JSFiddle the code works correctly.
$(document).ready(function() {
$("#example").DataTable();
});
.dataTables_length,
.dataTables_wrapper {
font-size: 1.6rem;
select,
input {
background-color: #f9f9f9; /*semi-colon expected*/
border: 1px solid #999; /*{ expected*/
border-radius: 4px; /* { expected*/
height: 3rem; /*{ expected*/
line-height: 2; /*{ expected*/
font-size: 1.8rem;/*{ expected*/
color: #333;
}
.dataTables_length,
.dataTables_filter {
margin-top: 30px;
margin-right: 20px;
margin-bottom: 10px;
display: inline-flex;
}
}
<div class="container">
<div class="row">
<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
</tbody>
</table>
</div>
</div>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
