How do I add another table at the bottom of screenshot below?
Thank you very experts for your continued assistance.
The screenshot below is as a result of this fiddle courtesy of kwood and the great JAKE.
How do I modify code below to add the portion that begins with Related Work Activity?
- $("#emps").on("click", "a[target='tab']", function(){
var me = $(this);
var url = me.attr("href");
var tabName = me.data("tabName");
var tabIndex = parseInt(me.data("tabIndex"), 10);
$.get(url, function(data) {
var table = $( '<table id="details" class="details" style="font-weight:bold;font-size:10pt;" cellpadding="4" width="100%" cellspacing="0" />'),
tr = $('<tr clss="d0"/>'),
td = $('<td/>'),
th = $('<th/>'),
table2 = $('<table class="details" style="background-color:#eeeeee;" cellpadding="4" width="100%" bordercolor="cellspacing="0" />');
tr = $('<tr clss="d1"/>'),
td = $('<td/>'),
th = $('<th/>'),
table2.html(tr.clone());
table2.append(tr.clone()).append(tr.clone());
var tr2 = table2.find('tr:first');
$.each(data[0], function(key,value) {
if($.inArray(key, ['RequestID','RequestInitiatedDate','RequestStatus','RequestClosedDate']) == -1) {
tr.clone().html(th.clone().html( key.replace(/[a-z][A-Z]/g, function(s) { return s.split('').join(' '); })))
.append(td.clone().html(value))
.appendTo(table);
} else {
th.clone().html( key.replace(/[a-z][A-Z]/g, function(s) { return s.split('').join(' ');
})).appendTo(tr2);
td.clone().html(value).appendTo(tr2);
if (key == 'RequestInitiatedDate') {
tr2 = tr2.next();
}
}
});
$(tabName).html(table2).append('<br>').append(table);
$("table#details tr:even").css("background-color", "#eeeeee");
$("table#details tr:odd").css("background-color", "#C0C0C0");
// Activate the tab once the page has loaded:
$("#tabs").tabs("option", "active", tabIndex);
}, 'json');
// Prevent the browser from following the link:
return false;
});
});
</script>
Thank you very much in advance