1.0.0 • Published 4 months ago

svelte-table-layout v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Svelte Table Layout

A dynamic table layout for Svelte, a drop-in replacement for HTML tables that use CSS grid under the hood. It lets you easily style columns and rows even if there are cells with nontrivial colspan & rowspan.

<Table class="my-table">
	<Row style="background: gray">
		<Cell>grey</Cell>
		<Cell>row</Cell>
		<Cell>with no decoration</Cell>
	</Row>
	<Row style="background: pink; border: 1px solid red;">
		<Cell colspan={2}>pink row</Cell>
		<Cell>with red border</Cell>
	</Row>
</Table>

<style>
	/* make all cells that intersect the third column bold */
	:global(.my-table [data-column~='3']) {
		font-weight: bold;
	}
</style>

It also supports colspan=row to make cells span the entire row, and lets you align the columns of two different tables.

<Table bind:computedColumnWidths={columns}>
	<Row>
		<Cell>a-really-long-cell</Cell>
		<Cell>normal-cell</Cell>
		<Cell>xd</Cell>
	</Row>
	<Row>
		<Cell colspan="row">lorem</Cell>
	</Row>
</Table>

<Table {columns}>
	<Row>
		<Cell>a</Cell>
		<Cell>b</Cell>
		<Cell>c</Cell>
	</Row>
	<Row>
		<Cell>d</Cell>
		<Cell>e</Cell>
		<Cell>f</Cell>
	</Row>
</Table>
1.0.0

4 months ago

0.0.13

9 months ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago