-
-
Save ilyasozkurt/244e81f6266717106b6a2edefdfa61db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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