Link to home
Start Free TrialLog in
Avatar of BasilFawlty001
BasilFawlty001Flag for Canada

asked on

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!
Avatar of Juana Villa
Juana Villa
Flag of United States of America image

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
Avatar of BasilFawlty001

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Julian.  You're my hero. Worked like a charm.

Thank You!
You are welcome.