Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6583465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:24:47+00:00 2026-05-25T16:24:47+00:00

I have been playin with dynamic changes to innerHTML content and have noticed some

  • 0

I have been playin with dynamic changes to innerHTML content and have noticed some strange behaviour with tables nested inside other elements.

For example form p /p p table /table /p /form was not seeing the table as innerHTML of the second p but instead listed the table as a sibling of that p tag rather than a child.

I figure this is a well known behaviour.

What is the gap in my knowlegde?

TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:24:47+00:00Added an answer on May 25, 2026 at 4:24 pm

    You can’t put a <table> inside a <p>. From the HTML4 specification:

    <!ELEMENT P - O (%inline;)* -- paragraph -->
    […]
    It cannot contain block-level elements (including P itself).

    And then if you look at what the %inline; elements are, you won’t find <table> in the list.

    And for HTML5, <p> can contain phrasing content:

    Permitted contents

    Phrasing content

    And phrasing content is character data and phrasing elements, phrasing elements are:

    a or em or strong or small … meter

    There’s no <table> in that list.

    So you’re trying to insert invalid HTML and the browser is changing <p><table></table></p> into <p></p><table></table> (i.e. moving the table child up to a sibling) in order to get valid HTML.

    If you give the browser invalid HTML, the browser will guess what you really mean and go with its guess.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been playin with Google's Page Speed, and it gave me some tips to
I have recently been playing with Massive, a Micro-ORM which returns collections of IEnumerable<dynamic>.
I have been playing with Node.js for some time. I have the following piece
I have been playing around with Dynamic Data but I find the filtering and
I have been playing around with writing some simple card games in Python for
I have been playing with some of Apple's example code for customizing UITableViewCells. I
I have been playing around with a search control and i have noticed that
I have some audio data (raw AAC) inside a byte array for playback. During
I have been playing around with the dynamic abilities of powershell and I was
I have been playing with the Ruby library shoes. Basically you can write a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.