Skip to content

Instantly share code, notes, and snippets.

@ilyasozkurt
Created February 24, 2023 09:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
function generateTableView(subtitles) {
const rows = subtitles.map(subtitle => `<tr>
<td>${subtitle.startTimeString}</td>
<td>${subtitle.endTimeString}</td>
<td>${subtitle.text}</td>
</tr>`);
const table = `<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Start Time</th>
<th>End Time</th>
<th>Subtitles</th>
</tr>
</thead>
<tbody>
${rows.join('')}
</tbody>
</table>`;
return table;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment