/bubble-tutorials

How to use DataTables plugins in Bubble

Learn how to add and configure DataTables plugins in Bubble to build fast, sortable, and interactive tables without complex coding.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a Free Consultation

How to use DataTables plugins in Bubble

To use DataTables in Bubble, you load the DataTables JS/CSS inside an HTML element, output your Bubble data as a plain HTML table, and initialize DataTables with a small JavaScript snippet. Bubble doesn’t support DataTables natively; you embed it manually.

 

What You Actually Do

 

You create a normal Bubble HTML element, place a basic HTML table inside it (rows populated by Bubble dynamic expressions), then run DataTables on that table using a standard script tag. Bubble allows JavaScript inside an HTML element, so you can initialize DataTables right there. This works because the table is rendered before the JavaScript runs.

  • You do NOT need a plugin.
  • You do NOT put the script inside the page header unless you want global loading.
  • The key is that Bubble must output a finished HTML table before DataTables initializes.

 

Step-by-Step Setup

 

Put an HTML element on the page and paste the following, replacing Search for Things with your actual data source.

 

<!-- Load DataTables + jQuery -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>

<!-- Build the table with Bubble dynamic data -->
<table id="mytable">
  <thead>
    <tr>
      <th>Name</th>
      <th>Created</th>
    </tr>
  </thead>
  <tbody>
    <!-- Bubble will repeat this row -->
    <!-- Example: a Thing called UserRecord -->
    <tr>
      <td>{{Search for UserRecord's Name:formatted as text}}</td>
      <td>{{Search for UserRecord's Created Date}}</td>
    </tr>
    <!-- Bubble repeats the <tr> if you use "Repeating" in the HTML element via Expression -->
  </tbody>
</table>

<script>
// Wait until Bubble finishes drawing the element
$(document).ready(function() {
    $('#mytable').DataTable(); // Initialize DataTables
});
</script>

 

Important Clarification

 

Bubble’s HTML element can’t “loop” itself, so most developers generate table rows using “Repeating group → HTML table mode” technique: put a Repeating Group on the page, but inside each cell use an HTML element that outputs a single <tr>. Then place an outer HTML element above/below with the static <table> wrapper. DataTables only needs a real rendered table; it doesn't care how Bubble produced it.

  • Make sure the table exists in the DOM before DataTables runs.
  • If DataTables initializes too early, wrap your script in setTimeout with 100–200ms.

Explore More Valuable No-Code Resources

How to integrate Bubble.io with Git?

Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.

Explore

How to integrate Bubble.io with Reddit Ads?

Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!

Explore

How to integrate Bubble.io with AWS S3?

Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.

Explore

How to integrate Bubble.io with Lucidchart?

Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.

Explore

How to integrate Bubble.io with Kentico?

Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.

Explore

How to integrate Bubble.io with Box?

Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.

Explore

Stuck in Bubble.io? We’re here to help!

Fix broken workflows | Optimize logic | Boost performance | Scale with confidence

4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences