Nová ukázka
Reset
Načíst z URL
Uložit a získat odkaz
Vztahuje se k…
Nevyplňujte
Napiště „nejsem robot“
▶
Přepnout zobrazení
Výsledek
<h1> Sticky tabulka </h1> <p>Tabulka s fixním záhlavím a sloupcem.</p> <div class="sticky-table"> <table> <thead> <tr> <th> Záhlaví <br> na dva řádky </th> <th> Záhlaví </th> <th> Záhlaví </th> <th> Záhlaví </th> <th> Záhlaví </th> <th> Záhlaví </th> <th class="sticky"> Záhlaví </th> </tr> </thead> <tbody> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky" class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> </tbody> </table> </div> <p>Druhá tabulka</p> <div class="sticky-table"> <table> <thead> <tr> <th> Druhé záhlaví <br> na dva řádky </th> <th> Záhlaví </th> <th> Záhlaví </th> <th> Záhlaví </th> <th> Záhlaví </th> <th> Záhlaví </th> <th class="sticky"> Záhlaví </th> </tr> </thead> <tbody> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky" class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> <tr> <td>lorem</td> <td>Lorem ipsum dolor</td> <td>sit amet, consectetur</td> <td>lorem</td> <td> adipisicing elit</td> <td>Quod, laboriosam</td> <td class="sticky"> <button>Upravit</button> </td> </tr> </tbody> </table> </div>
HTML
Autoformát
Standardní režim
Mobilní zobrazení
td, th { padding: 1em; letter-spacing: .5em; } th { background: silver; } th { position: sticky; position: -webkit-sticky; top: 0; z-index: 1; } .sticky { position: sticky; position: -webkit-sticky; right: 0; background: silver; border-left: 2px solid #fff; } .sticky-table { overflow: auto; max-height: 100vh; }
CSS
Autoformát
CSS reset
Až na konci
J
ava
S
cript
Autoformát
jQuery
Umístění JS
window.onload
</head>
</body>