Skip to content

Instantly share code, notes, and snippets.

@quyen91
Created June 27, 2017 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quyen91/a2decb0bdb513192b717b32451116f55 to your computer and use it in GitHub Desktop.
Save quyen91/a2decb0bdb513192b717b32451116f55 to your computer and use it in GitHub Desktop.
$(function(){
$.getJSON('trello_data.json', function(data) {
$.each(data.lists, function(i, f) {
// display name of all list
tr = $('<tr/>');
tr.attr('id', f.id);
tr.append("<th>" + f.name + "</th>");
$('table').append(tr)
});
$.each(data.cards, function(i, f) {
// expand card name in list
$('#'+ f.idList).append("<td width='200'>" + f.name + "</td>");
});
//set width for td in table
$("td").each(function(index) {
var htmlText = "<div style='width:100px;' class='item'>" + $(this).text() +"</div>";
$(this).html(htmlText);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment