Display Addresses in a Single Line in Table Components

Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add…

  • Not yet re-checked
  • Classic builder

Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

Screenshot for “Display Addresses in a Single Line in Table Components”

This is a great solution that you can use to display addresses in a table component across a single line as opposed to multiple lines by replacing the line break with a comma and a space.

Step 1

In your data table, double click your address field to add the CSS class of "address."

Screenshot for “Display Addresses in a Single Line in Table Components”

Step 2

Hover over the info icon of your data table to get the value of your component ID.

Screenshot for “Display Addresses in a Single Line in Table Components”

Step 3

Add the following code to the JavaScript tab of your page.

Text
TB.render('component_3', function(data) {
    var addresses = $(".address a"),
        x;
    for (x of addresses) {
        y = x.innerHTML;
        x.innerHTML = y.replace(/<br>/g, ", ");
    }
});
Screenshot for “Display Addresses in a Single Line in Table Components”

Original Community Post:

Display Addresses in a Single Line in Table Components - Community Discussions / Tips and Tricks - Tadabase Community

Was this page helpful?

Something wrong or missing on this page? Tell us.