I am attempting to create a scrollable table that scrolls both horizontally and vertically, using the example provided by .
In my project directory under src/components/ScrollExample.js, I have copied and pasted the HTML code. In addition, in src/styles/components/_scroll.scss, I have also copied and pasted the CSS code from the example. The resulting table looks exactly like the one in the example.
However, I am currently facing an issue. Although I have fixed the layout, I am unable to get the JavaScript functionality working.
I attempted to include the following code in public/index.html, but I encountered an error stating "Uncaught ReferenceError: $ is not defined":
$(document).ready(function () {
$('#dtHorizontalVerticalExample').DataTable({
"scrollX": true,
"scrollY": 200,
});
$('.dataTables_length').addClass('bs-select');
});
How can I resolve this error? I would greatly appreciate any help or suggestions you may have. Thank you.