i want to load a html table in a div
The HTML-Code is loaded via:
$("#table_wrapper").hide();
$.get("<?echo base_url();?>schichtplan/employee_fields/"+plan_id+"true",function(data){
$("#table_wrapper").html(data);
$("#table_wrapper").show();
});
Data is validated via alert and looks like:
<table border= '0'cellpadding='4' cellspacing='0' class='mitarbeiter' />
<thead>
<tr>
<th> </th><th><div id='plan_id:1;sort_id:1' class='edit_employee'>User1</div></th><th><div id='plan_id:1;sort_id:2' class='edit_employee'>User2</div></th></tr>
</thead>
<tbody>
<tr>
<td class='first'>Anstellung</td><td> </td><td> </td></tr>
<tr>
<td class='first'>Stundenlohn</td><td> </td><td> </td></tr>
<tr>
<td class='first'>Festlohn</td><td> </td><td> </td></tr>
<tr>
<td class='first'>Bonus</td><td> </td><td> </td></tr>
<tr>
<td class='first'>Kassenminus</td><td> </td><td> </td></tr>
<tr>
<td class='first'>Nachtzuschlag</td><td> </td><td> </td></tr>
<tr>
<td class='first'>Sonstiges</td><td> </td><td> </td></tr>
</tbody>
</table>
After the JQuery-Action the div looks like:
<div id="table_wrapper" style="display: block; "><table border="0" cellpadding="4" cellspacing="0" class="mitarbeiter"></table>
<div id="plan_id:1;sort_id:1" class="edit_employee">User1</div><div id="plan_id:1;sort_id:2" class="edit_employee">User2</div>
Anstellung
Stundenlohn
Festlohn
Bonus
Kassenminus
Nachtzuschlag
Sonstiges
</div>
Table-Code is generated with CodeIgniter.
I have no idea why the result looks like that
Some hint?
Thanks
There is a slash at the end of the tag that starts the table. Only some tags can be closed with the slash, and if a tag isn’t allowed to have the slash, it will be kept open for the rest of the page, which will make your html invalid. This is what it should look like: