Skip to Content Skip to Menu

🏖 Mid-Summer sale is here! Get 20% off professional and developer memberships with code SUMMER-2026!

CB User list formatted as a table

  • rbuelund
  • rbuelund
  • ONLINE
  • Posts: 640
  • Thanks: 43
  • Karma: 4
1 hour 8 minutes ago #344343 by rbuelund
CB User list formatted as a table was created by rbuelund
I once got a description her in the forum on how to convert a user list (frontend) to a table layout with an auto action. It used to work, but not anymore ?? I used this javascript in the auto action that is fired on the list - it just guves a blank page:

document.addEventListener("DOMContentLoaded", () => {
var body=document.body,
    parent=body.querySelector("#cbUserTable"),
    rows=parent.querySelectorAll(".cbUserListRow"),
    table=document.createElement("table"),
    tbody=document.createElement("tbody"),
    row=document.createElement("tr"),
    cell=document.createElement("td"),
    x=rows.length,
    cells=rows[0].querySelectorAll(".cbUserListRowColumn"),
    y=cells.length,
    i,j;
table.appendChild(tbody)
for(i=0;i<x;i++){
    row=row.cloneNode(0);
    cells=rows.querySelectorAll(".cbUserListRowColumn");
    y=cells.length;
    for(j=0;j<y;j++){
        cell=cell.cloneNode(0);
        cell.innerHTML=cells[j].innerHTML;
        row.appendChild(cell);
    }
    tbody.appendChild(row);
}
body.appendChild(table);
const element = document.getElementById("cbUserTable");
element.remove(); 
});

 

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum