List results in Line Breaks and not Comma Separated

Greetings all-

I was able to synthesize a javascript posting (Display Addresses in a Single Line in Table Components)

Works like a charm. (JS HAS BEEN UPDATED AS OF 9/12/24)

TB.render('component_XX', function(data) {
    // Select all elements with the class 'breaks'
    var linebreaks = document.querySelectorAll(".breaks");
    linebreaks.forEach(function(item) {
        var content = item.innerHTML;
        // Replace <br> tags with ", " (comma and space)
        item.innerHTML = content.replace(/<br\s*\/?>/g, ", ");
    });
});

Replace the component number with your own specific one and use “breaks” in the CSS class (or change it to something more suiting for your needs).

Hope this helps,
Adam

1 Like