mirror of
https://github.com/open-webui/open-webui
synced 2025-06-12 17:33:11 +00:00
enh: table view allow overflow
This commit is contained in:
parent
fa8d7bd9c6
commit
902f30c123
@ -34,34 +34,36 @@
|
|||||||
code={revertSanitizedResponseContent(token?.text ?? '')}
|
code={revertSanitizedResponseContent(token?.text ?? '')}
|
||||||
/>
|
/>
|
||||||
{:else if token.type === 'table'}
|
{:else if token.type === 'table'}
|
||||||
<table>
|
<div class="scrollbar-hidden relative whitespace-nowrap overflow-x-auto max-w-full">
|
||||||
<thead>
|
<table class="w-full">
|
||||||
<tr>
|
<thead>
|
||||||
{#each token.header as header, headerIdx}
|
|
||||||
<th style={token.align[headerIdx] ? '' : `text-align: ${token.align[headerIdx]}`}>
|
|
||||||
<MarkdownInlineTokens
|
|
||||||
id={`${id}-${tokenIdx}-header-${headerIdx}`}
|
|
||||||
tokens={header.tokens}
|
|
||||||
/>
|
|
||||||
</th>
|
|
||||||
{/each}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{#each token.rows as row, rowIdx}
|
|
||||||
<tr>
|
<tr>
|
||||||
{#each row ?? [] as cell, cellIdx}
|
{#each token.header as header, headerIdx}
|
||||||
<td style={token.align[cellIdx] ? '' : `text-align: ${token.align[cellIdx]}`}>
|
<th style={token.align[headerIdx] ? '' : `text-align: ${token.align[headerIdx]}`}>
|
||||||
<MarkdownInlineTokens
|
<MarkdownInlineTokens
|
||||||
id={`${id}-${tokenIdx}-row-${rowIdx}-${cellIdx}`}
|
id={`${id}-${tokenIdx}-header-${headerIdx}`}
|
||||||
tokens={cell.tokens}
|
tokens={header.tokens}
|
||||||
/>
|
/>
|
||||||
</td>
|
</th>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{#each token.rows as row, rowIdx}
|
||||||
|
<tr>
|
||||||
|
{#each row ?? [] as cell, cellIdx}
|
||||||
|
<td style={token.align[cellIdx] ? '' : `text-align: ${token.align[cellIdx]}`}>
|
||||||
|
<MarkdownInlineTokens
|
||||||
|
id={`${id}-${tokenIdx}-row-${rowIdx}-${cellIdx}`}
|
||||||
|
tokens={cell.tokens}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
{/each}
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
{:else if token.type === 'blockquote'}
|
{:else if token.type === 'blockquote'}
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<svelte:self id={`${id}-${tokenIdx}`} tokens={token.tokens} />
|
<svelte:self id={`${id}-${tokenIdx}`} tokens={token.tokens} />
|
||||||
|
Loading…
Reference in New Issue
Block a user