Skip to content

Instantly share code, notes, and snippets.

@deitrick
Created May 19, 2015 15:56
Show Gist options
  • Save deitrick/bac5e939029c4c860fe1 to your computer and use it in GitHub Desktop.
Save deitrick/bac5e939029c4c860fe1 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/lapimi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<table>
<thead>
<tr>
<th>Date</th>
<th>Subject</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script id="jsbin-javascript">
// Write a named function that takes the following object and converts it to a string
var obj = {
subject: "What if sorrows swim?",
date: "11/11/11",
from: "[email protected]",
to: "[email protected]"
};
console.log(generateTableRow(obj));
// "<tr><td class="date">11/11/11</td><td>What if sorrows swim?</td><td><span class="archive"></span><span class="delete"></td></tr>"
// THEN, add the string to the table body in the html. You should visually see the data in the Output tab.
</script>
<script id="jsbin-source-javascript" type="text/javascript">// Write a named function that takes the following object and converts it to a string
var obj = {
subject: "What if sorrows swim?",
date: "11/11/11",
from: "[email protected]",
to: "[email protected]"
};
console.log(generateTableRow(obj));
// "<tr><td class="date">11/11/11</td><td>What if sorrows swim?</td><td><span class="archive"></span><span class="delete"></td></tr>"
// THEN, add the string to the table body in the html. You should visually see the data in the Output tab.</script></body>
</html>
// Write a named function that takes the following object and converts it to a string
var obj = {
subject: "What if sorrows swim?",
date: "11/11/11",
from: "[email protected]",
to: "[email protected]"
};
console.log(generateTableRow(obj));
// "<tr><td class="date">11/11/11</td><td>What if sorrows swim?</td><td><span class="archive"></span><span class="delete"></td></tr>"
// THEN, add the string to the table body in the html. You should visually see the data in the Output tab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment