Skip to content

Instantly share code, notes, and snippets.

@asterion
Created April 27, 2017 20:24
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 asterion/0411bd597b79ce53750dfd4c70d872e9 to your computer and use it in GitHub Desktop.
Save asterion/0411bd597b79ce53750dfd4c70d872e9 to your computer and use it in GitHub Desktop.
javascript + css + json
var colors = {x: y};
for (h=0;h<24;h++){
i=h*2;
val1 = eval("json."+(root+i));//concat strings and values to access h vars
val2 = eval("json."+(root+(i+1)));
if (val1 != null && val2 != null){
table.append("<tr style=\"background-color:"+ colors[x] +"\"><td>"+formattedH(h)+":00 </td> <td id="+i+">"+val1+"</td><td id="+(i+1)+">"+val2+"</td></tr>");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment