27
rated 0 times
[
34]
[
7]
/ answers: 1 / hits: 31401
/ 8 Years ago, wed, february 3, 2016, 12:00:00
So I'm currently creating a dynamic table using some JavaScript and a set of objects. I need to add in some white space between the two but one space isn't enough, I need to have it almost tabbed out. What would be the best way to do this? Here is my code for it so far:
var sections = {
p1 : {sname: Dynamic Table, mscore: 20},
p2 : {sname: IntelliJ Usage, mscore: 10},
p3 : {sname: Calender Control, mscore: 30},
p4 : {sname: Active Form, mscore: 20},
p5 : {sname: Object Database, mscore: 20}
};
document.write(Object.keys(sections).reduce(function(s, p, i) {
var o = sections[p];
return s + (i>0?'<br><br><br><br>':'') + o.sname + ' ' + o.mscore + ' ' }, '')
);
More From » html