Fix <tr> is invalid inside <table>

This commit is contained in:
Abdo 2024-07-10 09:54:11 +03:00
parent 07d02990ab
commit c28d254b4d
4 changed files with 49 additions and 37 deletions

View file

@ -141,12 +141,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script> </script>
<table class="stats-table align-start"> <table class="stats-table align-start">
{#each statsRows as row} <tbody>
<tr> {#each statsRows as row}
<th class="align-start">{row.label}</th> <tr>
<td>{row.value}</td> <th class="align-start">{row.label}</th>
</tr> <td>{row.value}</td>
{/each} </tr>
{/each}
</tbody>
</table> </table>
<style> <style>

View file

@ -58,10 +58,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</div> </div>
<div class="counts-table"> <div class="counts-table">
<table> <table>
{#each tableData as d, _idx} <tbody>
<tr> {#each tableData as d, _idx}
<!-- prettier-ignore --> <tr>
<td> <!-- prettier-ignore -->
<td>
<span style="color: {d.colour};">&nbsp;</span> <span style="color: {d.colour};">&nbsp;</span>
{#if $prefs.browserLinksSupported} {#if $prefs.browserLinksSupported}
<button class="search-link" on:click={() => dispatch('search', { query: d.query })}>{d.label}</button> <button class="search-link" on:click={() => dispatch('search', { query: d.query })}>{d.label}</button>
@ -69,19 +70,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<span>{d.label}</span> <span>{d.label}</span>
{/if} {/if}
</td> </td>
<td class="right">{d.count}</td> <td class="right">{d.count}</td>
<td class="right">{d.percent}</td> <td class="right">{d.percent}</td>
</tr> </tr>
{/each} {/each}
<tr> <tr>
<td> <td>
<span style="visibility: hidden;"></span> <span style="visibility: hidden;"></span>
{total} {total}
</td> </td>
<td class="right">{graphData.totalCards}</td> <td class="right">{graphData.totalCards}</td>
<td /> <td />
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>

View file

@ -12,12 +12,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<div> <div>
<table dir={direction()}> <table dir={direction()}>
{#each tableData as { label, value }} <tbody>
<tr> {#each tableData as { label, value }}
<td class="align-end">{label}:</td> <tr>
<td class="align-start">{value}</td> <td class="align-end">{label}:</td>
</tr> <td class="align-start">{value}</td>
{/each} </tr>
{/each}
</tbody>
</table> </table>
</div> </div>

View file

@ -13,18 +13,24 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<div class="outer"> <div class="outer">
<table class="preview"> <table class="preview">
{#each $columnOptions.slice(1) as { label, shortLabel }} <thead>
<th>
{shortLabel || label}
</th>
{/each}
{#each $metadata.preview as row}
<tr> <tr>
{#each row.vals as cell} {#each $columnOptions.slice(1) as { label, shortLabel }}
<td>{cell}</td> <th>
{shortLabel || label}
</th>
{/each} {/each}
</tr> </tr>
{/each} </thead>
<tbody>
{#each $metadata.preview as row}
<tr>
{#each row.vals as cell}
<td>{cell}</td>
{/each}
</tr>
{/each}
</tbody>
</table> </table>
</div> </div>