Hide or remove table row attributes when there are no id tags.

How can I hide an HTML table attribute when the table has no ID?  I do not have access to the template that generates the table but I can add scripting and CSS to the page.

I'm using a system where empty tables are written to a web page.  Each table has multiple rows (tr height="85").  I would like to replace or remove the height attribute. A height of 85 is specific to this table.  There are multiple rows in the table, so the solution would need to hide or replace each row where height="85" on the page.

I tried replaceWith in a few variations but I'm not a coder so it's probable that I didn't do it right.    Thanks for your suggestions!
BasilFawlty001Asked:
Who is Participating?
 
Julian HansenCommented:
You can try this style
tr[height='85'] {
	display: none;
}

Open in new window


Working sample here
1
 
Juana VillaFront-end DeveloperCommented:
Hi,

You can hide or change the height of all the elements with an id.

tr[id] {
  display: none;
}

Open in new window


This is an example I made for you
0
 
BasilFawlty001Author Commented:
Thanks, Juana.

Unfortunately, the table and row have no id.  It's very frustrating but I have no control over that so all I can do is try to modify the attributes after the fact.
0
 
BasilFawlty001Author Commented:
Julian.  You're my hero. Worked like a charm.

Thank You!
0
 
Julian HansenCommented:
You are welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.