Last active
December 22, 2020 08:47
-
-
Save ankedsgn/df32c883d2dff617c6aba051401ef8e5 to your computer and use it in GitHub Desktop.
Responsive table - Adds th's to each td in mobile version
This file contains hidden or 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
if(window.innerWidth < 768) { | |
$('table.content-table').each(function( index ) { | |
var ths = $( this ).find('th'); | |
var trs = $( this ).find('tr'); | |
trs.each(function(){ | |
$(this).find('td').each(function(i){ | |
var text="<span>"+ths.eq(i).html()+"</span>"; | |
$(this).prepend(text); | |
}) | |
}); | |
}); | |
} |
This file contains hidden or 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
<table class="content-table"> | |
<tr> | |
<th>Type snelheid</th> | |
<th>Uitleg</th> | |
<th>Meten</th> | |
</tr> | |
<tr> | |
<td>Geadverteerde download- en uploadsnelheid</td> | |
<td>De maximale tot internetsnelheid zoals gecommuniceerd</td> | |
<td>Niet van toepassing</td> | |
</tr> | |
<tr> | |
<td>Maximale download- en uploadsnelheid</td> | |
<td>De maximale internetsnelheid op basis van de technische mogelijkheden </td> | |
<td>90% van de maximale snelheid moet tenminste in1 van de 10 uitgevoerde metingen gemeten worden</td> | |
</tr> | |
<tr> | |
<td>Geadverteerde download- en uploadsnelheid</td> | |
<td>De maximale tot internetsnelheid zoals gecommuniceerd</td> | |
<td>Niet van toepassing</td> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment