forked from StartPolymer/s-table
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paths-table.html
More file actions
118 lines (93 loc) · 2.69 KB
/
s-table.html
File metadata and controls
118 lines (93 loc) · 2.69 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
<!--
@license
Copyright (c) 2017 The StartPolymer Project Authors. All rights reserved.
This code may only be used under the MIT License found at https://github.com/StartPolymer/license
The complete set of authors may be found at https://github.com/StartPolymer/authors
The complete set of contributors may be found at https://github.com/StartPolymer/contributors
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/color.html">
<link rel="import" href="../paper-styles/default-theme.html">
<!--
`s-table`
Responsive HTML table extended with Polymer and Material Design.
@demo demo/s-table.html
-->
<dom-module id="s-table">
<template>
<style>
:host {
display: block;
position: relative;
border-spacing: 0;
font-size: 13px;
}
:host([fixed-column]) #container {
margin-left: var(--s-table-fixed-column-width, 192px);
}
:host([fixed-column]) #table ::slotted(tbody) tr td:nth-of-type(1),
:host([fixed-column]) #table ::slotted(tfoot) tr td:nth-of-type(1),
:host([fixed-column]) #table ::slotted(thead) tr th:nth-of-type(1) {
@apply(--layout);
@apply(--layout-center-center);
position: absolute;
left: 0;
width: var(--s-table-fixed-column-width, 192px);
}
#container {
overflow-x: auto;
padding-bottom: var(--s-table-scrollbar-height, 8px);
}
#container::-webkit-scrollbar {
height: var(--s-table-scrollbar-height, 8px);
}
#container::-webkit-scrollbar-track {
border-radius: var(--s-table-scrollbar-border-radius, 2px);
}
#container::-webkit-scrollbar-thumb {
border-radius: var(--s-table-scrollbar-border-radius, 2px);
background-color: var(--s-table-scrollbar-color, var(--divider-color));
}
#table {
display: table;
width: 100%;
}
#table ::slotted(tbody) td,
#table ::slotted(tfoot) td {
box-sizing: border-box;
height: var(--s-table-row-height, 48px);
padding: 0 var(--s-table-gutter, 24px);
white-space: nowrap;
border-bottom: 1px solid var(--s-table-divider-color, var(--divider-color));
}
#table ::slotted(thead) th {
box-sizing: border-box;
height: var(--s-table-head-row-height, 56px);
padding: 0 var(--s-table-gutter, 24px);
white-space: nowrap;
color: var(--secondary-text-color);
border-bottom: 1px solid var(--s-table-divider-color, var(--divider-color));
font-size: 12px;
font-weight: normal;
}
#table ::slotted(tbody) tr.iron-selected td {
background-color: var(--paper-grey-100);
}
#table ::slotted(tbody) tr:hover td {
background-color: var(--paper-grey-200);
}
</style>
<div id="container">
<div id="table">
<slot></slot>
</div>
</div>
</template>
<script>
Polymer({
is: 's-table',
extends: 'table'
});
</script>
</dom-module>