Skip to content

Instantly share code, notes, and snippets.

@ilyasozkurt
Created February 24, 2023 09:51
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 ilyasozkurt/244e81f6266717106b6a2edefdfa61db to your computer and use it in GitHub Desktop.
Save ilyasozkurt/244e81f6266717106b6a2edefdfa61db to your computer and use it in GitHub Desktop.
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