Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ HTML Script displays pages of space

Posted by: wolf Nov 24 2020, 06:13 AM

I have a page on my website http://www.1728.org/moons.htm
that displays a huge amount of unwanted space (roughly 3 pages) between one section of text and another.
(It 'splits' where it says 'calculator located here' and a table that says 'Planet / Moon Name / Moon Radius (km), etc')
I've used tables on many pages but I've never had a problem like this before.
Your help would be greatly appreciated. smile.gif
Thanks.


Posted by: pandy Nov 24 2020, 06:43 AM

This is a mystery. Below the point you pointed out something is injecting a load of BR tags. My browser's inspector shows them but they don't show when I view source. So I suspected the ad scripts. But removing all of them and also disabling JS didn't make the BR tags go away.

I don't get this. If it were something server side, some kind of include, the BR tags would show when viewing source. How can this happen if it isn't JS doing it? unsure.gif


Attached thumbnail(s)
Attached Image

Posted by: Christian J Nov 24 2020, 10:47 AM

Interesting, I get nested FONT tags. unsure.gif

There are lots of HTML syntax errors, and when I removed the (real) BR elements between the table rows the gap disappeared for some reason.

Still doesn't explain where all the ghost HTML elements come from. unsure.gif

Posted by: pandy Nov 24 2020, 10:55 AM

Huh? Do you see font tags where I see BR? With the inspector? unsure.gif

CODE
when I removed the (real) BR elements between the table rows the gap disappeared for some reason.


No, that makes sense. Stuff between table tags bubbles upwards... You know, if you have word there it shows above the table. Why wouldn't BR do the same? I didn't notice them. I stopped looking when I saw the long column with BR tags with the inspector.

Posted by: pandy Nov 24 2020, 11:06 AM

Removing the BR tags you found removed that column of BR tags from the inspector. So they bubbled up in the inspector too! How quaint. I used Iron BTW.

Posted by: pandy Nov 24 2020, 12:18 PM

Wolf, the BR tags Christian spotted are your problem. Remove all of them.

You can't have anything between the tags that make up a table, no matter if it's text or other tags. Nothing goes there. All content must be placed in the TDs (or THs)

CODE
<table>
   <!-- Nothing goes here -->
   <tr>
      <!-- Nothing goes here -->
      <td>Everything goes here!</td>
      <!-- Nothing goes here -->
   </tr>
   <!-- Nothing goes here -->
</table>

Posted by: Christian J Nov 24 2020, 02:27 PM

QUOTE(pandy @ Nov 24 2020, 04:55 PM) *

Huh? Do you see font tags where I see BR? With the inspector? unsure.gif

Yes, tested with Firefox and Vivaldi:

CODE
<font face="Arial"><font color="000066"><font size="4">

  

</font></font></font><font face="Arial"><font color="000066"><font size="4"><br>




</font></font></font>

The first FONT group has no BR, but subsequent ones appear to, didn't check them all. tongue.gif

Posted by: Christian J Nov 24 2020, 02:28 PM

QUOTE(pandy @ Nov 24 2020, 04:55 PM) *

No, that makes sense. Stuff between table tags bubbles upwards... You know, if you have word there it shows above the table.

That's a relief, at first I suspected Google of circumventing my javascript blocker. wacko.gif

Posted by: pandy Nov 25 2020, 12:52 AM

The FONT tags are really strange!

In a way it's strange with the BR bubbling I saw too. I mean, what is the inspector really? A mix of View Source and how the browser displays the HTML and then some? I've noticed on occasion that they show inexplicable things before. But I don't remember the context, just that I gave up.

Posted by: Christian J Nov 25 2020, 01:58 PM

QUOTE(pandy @ Nov 25 2020, 06:52 AM) *

The FONT tags are really strange!

I get them in all my browsers, including Opera12/Presto and IE11/Trident. Where did you only get BRs, in K-Mel?

QUOTE
In a way it's strange with the BR bubbling I saw too. I mean, what is the inspector really? A mix of View Source and how the browser displays the HTML and then some? I've noticed on occasion that they show inexplicable things before. But I don't remember the context, just that I gave up.

I don't know, but since the Inspector shows the same as the viewport rendering I guess it's some kind of processed version of the DOM tree. That still doesn't explain why tables "bubbles" those BRs, or where the nested FONT tags come from, though. unsure.gif


Posted by: pandy Nov 25 2020, 02:38 PM

No, K-mel doesn't have an inspector. As I said above it was Iron.

Anyhow, the BR tags are at least there in the source even if not together like that, but how can they be converted to FONT? That's really crazy.

Posted by: Christian J Nov 25 2020, 06:38 PM

QUOTE(pandy @ Nov 25 2020, 08:38 PM) *

No, K-mel doesn't have an inspector. As I said above it was Iron.

I have the attention span of a goldfish. cool.gif Pale Moon shows FONT elements too.

QUOTE
Anyhow, the BR tags are at least there in the source even if not together like that, but how can they be converted to FONT? That's really crazy.

Could the FONTs be part of the https://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/, that's not supposed to be exposed (except by bugs)? But the linked page says such elements can't be styled with ordinary CSS, yet when I added CSS borders to FONT elements in the OP's HTML code the ghost FONTs were styled too.

I recall Darin(?) linked to an old page about ghost HTML over a decade ago, but can't find it now. Was that about the Shadow DOM too?



Posted by: wolf Nov 25 2020, 08:56 PM

I certainly appreciate all the work you folks have done.
I thought the answer (if it even exists) would be simpler but I guess not.

Posted by: pandy Nov 25 2020, 09:47 PM

But it is simple! It was how the browsers' inspectors reacted to it that was confusing to us.

Just remove all the BR tags you have after each </tr> in the table after the gap. They aren't allowed there and they show up in the way you see, creating the big gap.

Just a sample, There is a BR after each row.

<TR><TD>  Earth</TD><TD> Moon</TD><TD> 1,737.1</TD><TD> 384,399</TD><TD> 27.325582</TD><TD> BC</TD></TR><BR>

<TR><TD>  *****</TD><TD> *****</TD><TD> *****</TD><TD> *****</TD><TD> *****</TD><TD> *****</TD></TR><BR>

<TR><TD>  Mars</TD><TD> Phobos</TD><TD> 11.1</TD><TD> 9,380</TD><TD> 0.319</TD><TD> 1877</TD></TR><BR>

<TR><TD>  Mars</TD><TD> Deimos</TD><TD> 6.2</TD><TD> 23,460</TD><TD> 1.262</TD><TD> 1877</TD></TR><BR>

<TR><TD>  *****</TD><TD> *****</TD><TD> *****</TD><TD> *****</TD><TD> *****</TD><TD> *****</TD></TR><BR>

Posted by: Christian J Nov 26 2020, 07:38 AM

QUOTE(pandy @ Nov 26 2020, 03:47 AM) *

Just a sample, There is a BR after each row.

Yes, over a hundred. The easiest might be to use the Replace feature in a text editor, and replace each </tr><br> with just </tr>. Make sure to keep a backup in case something goes wrong.

Posted by: Christian J Nov 26 2020, 12:24 PM

QUOTE(pandy @ Nov 25 2020, 08:38 PM) *

Anyhow, the BR tags are at least there in the source even if not together like that, but how can they be converted to FONT? That's really crazy.

Now I checked if those FONT colors and sizes existed in the source, and indeed here's a single one where it's not allowed:

CODE
<TABLE width=90% BORDER="1" BORDERCOLOR="#000000" CELLSPACING="2" CELLPADDING="3">
<font face = Arial><font color=000066><font size=4>
  

<TR><TD>  Planet </TD><TD>  Moon<BR>  Name</TD><TD>  Moon<BR>  Radius<BR>   (km)</TD><TD>  Orbital<BR>  Radius<BR>   (km)</TD><TD>  Period<BR>  Days</TD><TD>  Year<BR>  Disc</TD></TR><BR>

But why is it duplicated 179 times? wacko.gif

Posted by: wolf Nov 26 2020, 10:30 PM

SUCCESSFUL !!!
Thanks to all of you for all that help!!! smile.gif


Posted by: pandy Nov 27 2020, 01:11 AM

You are welcome. wink.gif

You have other errors too. It probably worth while for you to try to improve your understanding of HTML a little. Sooner or later errors cause problems in one way or another, as happened now.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)