Cant seem to get CSS working on an appended table
- by battlenub
I have an ajax request to a php file returning me rows of 3 values each.
I want to append these into a table. This works. I get my info in my table but I can't seem to add classes or id's and get some styling on it.
http://jsfiddle.net/AKh4n/1/
success : function(data) {
$('#lijstbeh').empty();
var data2 = jQuery.parseJSON(data);
$('#lijstbeh').append('<table class="table">');
$('#lijstbeh').append('<tr>');
$('#lijstbeh').append('<th>Behandeling ID</th>');
$('#lijstbeh').append('<th>Behandeling kort</th>');
$('#lijstbeh').append('<th>Behandeling datum</th>');
$('#lijstbeh').append('</tr>');
$.each (data2,function (bb)
{
$('#lijstbeh').append('<tr class="tblbehandelingen">');
$('#lijstbeh').append('<td>' + data2[bb].BEH_ID + '</td>');
$('#lijstbeh').append('<td>' + data2[bb].BEH_behandelingkort + '</td>');
$('#lijstbeh').append('<td>' + data2[bb].BEH_datum + '</td>');
$('#lijstbeh').append('</tr>');
});
$('#lijstbeh').append('</table>');
}