Skip to content

Commit 0eff082

Browse files
authored
Merge pull request #181 from Dezolated/sticky-table-header
2 parents a898536 + f37e01a commit 0eff082

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@editorjs/table",
33
"description": "Table for Editor.js",
4-
"version": "2.4.4",
4+
"version": "2.4.5",
55
"license": "MIT",
66
"repository": "https://github.com/editor-js/table",
77
"files": [

src/styles/table.pcss

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@
7272
& .tc-row:first-child {
7373
font-weight: 600;
7474
border-bottom: 2px solid var(--color-border);
75-
75+
position: sticky;
76+
top: 0;
77+
z-index: 2;
78+
background: var(--color-background);
7679
& [contenteditable]:empty::before {
7780
content: attr(heading);
7881
color: var(--color-text-secondary);
@@ -99,9 +102,18 @@
99102
}
100103

101104
.tc-add-column {
102-
padding: 4px 0;
103-
justify-content: center;
105+
display: grid;
104106
border-top: 1px solid var(--color-border);
107+
grid-template-columns: var(--cell-size);
108+
grid-auto-rows: var(--cell-size);
109+
place-items: center;
110+
svg {
111+
padding: 5px;
112+
position: sticky;
113+
top: 0;
114+
background-color: var(--color-background);
115+
}
116+
105117
&--disabled {
106118
visibility: hidden;
107119
}
@@ -116,8 +128,8 @@
116128
align-items: center;
117129
padding-left: 4px;
118130
position: relative;
119-
&--disabled{
120-
display : none;
131+
&--disabled {
132+
display: none;
121133
}
122134

123135
&::before {
@@ -198,4 +210,4 @@
198210

199211
.tc-wrap--readonly .tc-row::after {
200212
display: none;
201-
}
213+
}

0 commit comments

Comments
 (0)