By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Jquery Datatable not working with html table


New Coder
Hi all,

I'm having an issue where im trying to convert a html table to a DataTable using Jquery, however I am seeing NO change.

I've added the links so that JQuery is first, datatables.css is second, then datables.js is third.

I got the 2 Datatable links from:

And I for the JQuery CDN from:

See code below. I'm not sure what i'm doing wrong!

Many thanks for any insights

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.css">
    <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.js"></script>

<div class="container">
    <h1>Product Table</h1>
    <table class='table table-bordered' id="product_table">
                <th>Product ID</th>
                <th>Product Name</th>
                <th>Price (£)</th>
        {% for product in products %}
        {% endfor %}
</div><!--End of display table-->
{% endblock %}

<script type="text/javascript">
Last edited:

New Threads

Latest posts

Buy us a coffee!

Top Bottom