How to hide all elements (tables) if their width is identical to some (200) pixels?

Say I came across a page with 100 tables: 50 tables are of 100 width and 50 tables are of 200 width.

The tables of 200 width are irrelevant to me and I want to hide them with an if () statement.

The problem his, they don’t have a selector and I need to select time by their Width. Is this possible?

I tried this, but didn’t work:

document.querySelectorAll('table').forEach( (e)=> {
  if (table.width === 300) {
    e.style.visibility = 'hidden';
  }
});

Edit: I most desire a vanilla solution.

Use the offsetWidth property of the table elements, also make sure the dom is ready before trying to acces it :

function removeTables() { 
     document.querySelectorAll('table').forEach( (e)=> {
      if (e.offsetWidth >= 200) {
        e.style.display = "none";
      }
    });
}

window.onload = function() {
 removeTables()
};

Try below script. Here i used jquery each() function to iterate through all tables in the page. Hope it helps.

$(document).ready(function(){
    $('table').each(function(){
    if($(this).width()==125){
        $(this).hide();
    }
  });
});

Check this fiddler for reference.