Jump to content
Sign in to follow this  
Followers 2
10011010

Bug: Table & Div

Recommended Posts

Hello,

I noticed today that something is amiss with at least <table> and <div> usage in the cache description. I haven't done thorough testing but when I wanted to create a box with a boarder to contain some text, the page inserts </table> or </div> as the case may be immediately after the opening tag. So all I end up with is an empty box followed by the text I wanted in it. I have used this stylistic technique many times before so I was surprised when I discovered it today.

Thanks. I hope things can be restored easily.

 

 

 

 

Share this post


Link to post

[edit]

 

I found the problem. If I terminate the opening tag with a slash then it throws the site scripting into a tail spin. For example, this is no good:

 

<div style="something:orother;" />

some text

</div>

 

But this appears to work fine:

 

<div style="something:orother;">

some text

</div>

 

And <table> has a similar effect.

 

Thanks for listening.

Edited by 10011010

Share this post


Link to post
On 6/3/2018 at 4:14 AM, 10011010 said:

[edit]

 

I found the problem. If I terminate the opening tag with a slash then it throws the site scripting into a tail spin. For example, this is no good:

 

<div style="something:orother;" />

some text

</div>

 

Just to clarify.   Typically HTML tags are done in pairs:  There is an opening tag, and an end tag that wraps some content.

 

For example

<div>
Hello World
</div>

However,  an HTML tag can also be written as a "self closing tag" but putting the slash before the greater than sign.  One of the most common usages is for a line break, for example

<br />

What you have done is create a self closing tag, followed by some text, then an end tag </div>

 

When parsing the HTML, the parser sees that the div tag as a self closing tag, which make the </div> tag unexpected.  Browsers are tolerant of some malformed HTML, for example, using <br> instead of <br /> or unclosed <img> tags, but the div element is used for structuring HTML and a parser may be less tolerant.

  • Helpful 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 2

×