Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b3ca6df

Browse filesBrowse files
committed
Customize table
1 parent 7b36997 commit b3ca6df
Copy full SHA for b3ca6df

File tree

6 files changed

+57
-0
lines changed
Filter options

6 files changed

+57
-0
lines changed

‎src/components/Counter/Counter.svx

Copy file name to clipboardExpand all lines: src/components/Counter/Counter.svx
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ items:
1212

1313
---
1414

15+
{ items.length }
1516

1617
<!-- ---
1718
subtitle: Counter example

‎src/mdx-layouts/MenuLayout.svelte

Copy file name to clipboardExpand all lines: src/mdx-layouts/MenuLayout.svelte
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
<script context="module">
2+
import Table from './custom/Table.svelte'
3+
import Th from './custom/Th.svelte'
4+
import Tr from './custom/Tr.svelte'
5+
import Td from './custom/Td.svelte'
6+
7+
export {
8+
Table as table,
9+
Th as th,
10+
Tr as tr,
11+
Td as td
12+
}
13+
</script>
14+
115
<script>
216
export let items = []
317
</script>

‎src/mdx-layouts/custom/Table.svelte

Copy file name to clipboard
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="table-wrapper">
2+
<table>
3+
<slot></slot>
4+
</table>
5+
</div>
6+
7+
<style>
8+
.table-wrapper {
9+
max-width: 100%;
10+
overflow-x: auto;
11+
}
12+
table {
13+
border-collapse: collapse;
14+
}
15+
</style>

‎src/mdx-layouts/custom/Td.svelte

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<td>
2+
<slot></slot>
3+
</td>
4+
5+
<style>
6+
td {
7+
padding: 2px 10px;
8+
}
9+
</style>

‎src/mdx-layouts/custom/Th.svelte

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<th>
2+
<slot></slot>
3+
</th>
4+
5+
<style>
6+
th {
7+
padding: 5px 10px;
8+
}
9+
</style>

‎src/mdx-layouts/custom/Tr.svelte

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<tr>
2+
<slot></slot>
3+
</tr>
4+
5+
<style>
6+
tr {
7+
border-bottom: 2px solid #009800;
8+
}
9+
</style>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.