-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathshift-table-columns.html
More file actions
122 lines (118 loc) · 4.63 KB
/
shift-table-columns.html
File metadata and controls
122 lines (118 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VSCode Elements</title>
<link
rel="stylesheet"
href="/node_modules/@vscode/codicons/dist/codicon.css"
id="vscode-codicon-stylesheet"
nonce="abc123"
>
<style nonce="abc123">
.table {
width: 500px;
height: 300px;
}
</style>
<script
type="module"
src="/node_modules/@vscode-elements/webview-playground/dist/index.js"
nonce="abc123"
></script>
<script type="module" src="/dist/main.js" nonce="abc123"></script>
<script nonce="abc123">
window.vscodeWebviewPlaygroundNonce = 'abc123';
const logEvents = (selector, eventType) => {
document.querySelector(selector).addEventListener(eventType, (ev) => {
console.log(ev);
});
};
</script>
</head>
<body>
<h1>Basic example</h1>
<main>
<vscode-demo>
<vscode-table class="table" resizable style="margin-left: 200px">
<vscode-table-header slot="header">
<vscode-table-header-cell min-width="30" preferred-width="25"
>Id</vscode-table-header-cell
>
<vscode-table-header-cell min-width="70" preferred-width="50"
>First name</vscode-table-header-cell
>
<vscode-table-header-cell min-width="70" preferred-width="75"
>Last name</vscode-table-header-cell
>
<vscode-table-header-cell min-width="70" preferred-width="auto"
>Email</vscode-table-header-cell
>
<vscode-table-header-cell min-width="70" preferred-width="auto"
>Company</vscode-table-header-cell
>
</vscode-table-header>
<vscode-table-body slot="body">
<vscode-table-row>
<vscode-table-cell
>30b1851f-393a-4462-ba28-133df9951cae</vscode-table-cell
>
<vscode-table-cell>Leonel</vscode-table-cell>
<vscode-table-cell>Feeney</vscode-table-cell>
<vscode-table-cell>Jarrod.Beatty@hotmail.com</vscode-table-cell>
<vscode-table-cell>Adams, Kozey and Dooley</vscode-table-cell>
</vscode-table-row>
<vscode-table-row>
<vscode-table-cell
>a7deaa18-0475-468f-a4e3-046df5ad2878</vscode-table-cell
>
<vscode-table-cell>Emerson</vscode-table-cell>
<vscode-table-cell>Collins</vscode-table-cell>
<vscode-table-cell>Kiarra_Predovic@hotmail.com</vscode-table-cell>
<vscode-table-cell>Yost LLC</vscode-table-cell>
</vscode-table-row>
<vscode-table-row>
<vscode-table-cell
>31b666d3-765d-45c9-bbbc-9d2cb64b9ff0</vscode-table-cell
>
<vscode-table-cell>Damien</vscode-table-cell>
<vscode-table-cell>Bednar</vscode-table-cell>
<vscode-table-cell>Clement57@yahoo.com</vscode-table-cell>
<vscode-table-cell>Welch and Sons</vscode-table-cell>
</vscode-table-row>
<vscode-table-row>
<vscode-table-cell
>72c76b94-c878-4046-85d6-28f4ebbca913</vscode-table-cell
>
<vscode-table-cell>Filomena</vscode-table-cell>
<vscode-table-cell>Dach</vscode-table-cell>
<vscode-table-cell>Morton_Nienow26@gmail.com</vscode-table-cell>
<vscode-table-cell>Rosenbaum - Wilkinson</vscode-table-cell>
</vscode-table-row>
</vscode-table-body>
</vscode-table>
</vscode-demo>
<button id="bt-empty">empty table body</button>
<button id="bt-append">Append row</button>
<script type="module">
const btEmpty = document.querySelector('#bt-empty');
const btAppend = document.querySelector('#bt-append');
btEmpty.addEventListener('click', () => {
document.querySelector('vscode-table-body').innerHTML = '';
});
btAppend.addEventListener('click', () => {
const row = document.createElement('vscode-table-row');
row.innerHTML = `
<vscode-table-cell>cell</vscode-table-cell>
<vscode-table-cell>cell</vscode-table-cell>
<vscode-table-cell>cell</vscode-table-cell>
<vscode-table-cell>cell</vscode-table-cell>
<vscode-table-cell>cell</vscode-table-cell>
`;
document.querySelector('vscode-table-body').append(row);
});
</script>
</main>
</body>
</html>