Skip to content

Commit bf7f9fd

Browse files
centering of table
1 parent 57646c0 commit bf7f9fd

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

custom.css

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ body {
4545
}
4646

4747
.reveal .slides {
48-
top: 0;
49-
left: 0;
50-
margin: 0;
48+
top: 0 !important;
49+
left: 0 !important;
50+
width: 100% !important;
51+
height: 100% !important;
52+
margin: 0 !important;
53+
transform: none !important;
5154
}
5255

5356
.reveal .slides section {
@@ -81,7 +84,7 @@ body {
8184
margin-top: 0 !important;
8285
}
8386

84-
.reveal .slides section > :not(table):not(figure):not(pre) {
87+
.reveal .slides section > :not(table):not(figure):not(pre):not(section) {
8588
margin-left: 0 !important;
8689
margin-right: 0 !important;
8790
max-width: min(72ch, 100%) !important;
@@ -189,7 +192,7 @@ body {
189192
.reveal .slides section > figure:has(> table:not(.hljs-ln)) {
190193
margin-left: auto !important;
191194
margin-right: auto !important;
192-
transform: translateX(calc((var(--slide-pad-right) - var(--slide-pad-left)) / 2));
195+
transform: translateX(calc((var(--slide-pad-left) - var(--slide-pad-right)) / 2));
193196
}
194197

195198
.reveal .slides section > figure {
@@ -214,20 +217,27 @@ body {
214217
transform: none !important;
215218
}
216219

217-
.reveal .slides section.table-only-slide {
218-
display: flex !important;
219-
flex-direction: column;
220-
justify-content: center;
220+
/* Override Reveal's display:block on .present; use grid for reliable centering */
221+
.reveal .slides section.table-only-slide,
222+
.reveal .slides section.table-only-slide.present {
223+
display: grid !important;
224+
place-items: center;
225+
place-content: center;
221226
min-height: calc(100vh - 6.2rem);
222227
padding-top: 0 !important;
223228
padding-bottom: 1.8rem;
229+
padding-left: var(--slide-pad-right) !important;
230+
padding-right: var(--slide-pad-right) !important;
231+
overflow: visible;
224232
}
225233

226234
.reveal .slides section.table-only-slide > table:not(.hljs-ln),
227235
.reveal .slides section.table-only-slide > figure {
228-
margin-left: auto !important;
229-
margin-right: auto !important;
230-
transform: translateX(calc((var(--slide-pad-right) - var(--slide-pad-left)) / 2)) !important;
236+
margin: 0 !important;
237+
transform: none !important;
238+
max-width: min(80ch, 100%);
239+
justify-self: center;
240+
align-self: center;
231241
}
232242

233243
.reveal .slides section.table-only-slide > figure > table:not(.hljs-ln) {

0 commit comments

Comments
 (0)