This is due to:
replacing </p> by <br>
![]() | <p>hello</p></p> (explicit close) |
![]() | <p>hello</p><br> |
![]() | <p>abc<br><table>...</table></p> (implicit close) |
![]() | <p>abc<br></p><table>...</table> |
In the above sample, the <p> tag is implicitely closed when a new "block-level" tag like <table> is opened. For more info, read the definition of <p>.
Bring the tags to the right order, remove the additional tag or move the closing tag in front of the block element.