Explanation:
I have a <div>
parent that contains two <div>
daughters, however I would like to insert a <table>
using javascript, between, that is, in the middle of these two <div>
daughters that already exist in <div>
parent .
But my <table>
is a string that contains the HTML code as a value.
Code of my <table>
as string:
var HTMLString = '<table id="teste"><tbody id="appender"><tr class="header"><td class="cod">Código</td> <td class="nome">Nome</td><td class="tipo">Cidade - Estado</td></tr></tbody></table>';
HTML of the parent div and child div:
<div id=elementoPai>
<div id="fixedHeader_outer">
<div id="fixedHeader">conteudo</div>
</div>
<!-- quero que a HTMLString se transforme num html que apareça aqui no meio das duas -->
<div id="pnlOpcoes_outer">
<div id="pnlOpcoes">conteudo</div>
</div>
</div>
JSFiddle Example
Question:
How could I do this? I would like several solutions, mentioning the advantages and disadvantages of them, being able to use jQuery or not