How to remove non-breaking spaces from HTML hard coding

812 views Asked by At

I know this has been asked before in different ways, however, I am new to Javascript coding and don't entirely understand how to tailor the advice for my issue.

I am trying to remove the "&nbsp" from the line of hard coding below... actually, if I could remove the whole table row that would be great.

<tr class="Contents"><td>&nbsp;</td></tr>

I cannot edit the HTML code to remove the space or table row myself because it is hard-coded into the system I'm working with. However, I can add CSS and Javascript codes to override formatting and hide things. I cannot hide the class "Contents" or the "tr, td" attributes because other elements within the code are using those identifiers.

How can I go about hiding this specific line of coding, or others like it, using CSS or Javascript?

Edit:
The original HTML code itself cannot be modified. The system I am using restricts modification of the html hard coding because some of the elements are necessary for the program to work. However, this specific code is used as a line break to create space above and below a "register" button, and it is not needed on a new design. I can use CSS or javascript to impose modifications, but the original coding cannot be touched.

1

There are 1 answers

3
SPQR On

If you want to remove the whole table row then simply delete the line of code. If you're asking something else, perhaps you should edit your question.

edit: I'm not that familiar with HTML/HTML standards, but one possibility is to add an id then use CSS to hide it.

HTML:

<tr class="Contents" id="hidethis"><td>&nbsp;</td></tr>

CSS:

#hidethis { visibility: hidden;}