Topic: How to get noFoundMessage to span all columns?

Stig Kølbæk priority asked 2 years ago


Hi,

In DataTables the noFoundMessage option is held within one column as seen below, how can I make this span over in my case 3 columns and centered?

enter image description here


Dawid Wajszczuk staff answered 2 years ago


Hi,

You can write something like this in search function

document.getElementById('datatable-search-input').addEventListener('input', (e) => {
  instance.search(e.target.value);
  const td = document.querySelector('td')
  if (td.innerText === "No matching results found"){
    td.setAttribute('colspan', 3)
    td.style.textAlign = 'center'
  }
});

Here is the snippet https://mdbootstrap.com/snippets/standard/d-wajszczuk/3520038#js-tab-view.

Keep coding,
Dawid



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.0
  • Device: HP FireFly
  • Browser: Chrome
  • OS: Win 11
  • Provided sample code: No
  • Provided link: No