Skip to content

Commit fd0c940

Browse files
committed
Center table only when in card body; undo flex-basis
1 parent f95e069 commit fd0c940

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

js/dataframe/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,6 @@ export class ShinyDataFrameOutput extends HTMLElement {
484484

485485
const myDiv = document.createElement("div");
486486
myDiv.classList.add("html-fill-container", "html-fill-item");
487-
myDiv.style.marginLeft = "auto";
488-
myDiv.style.marginRight = "auto";
489487
target.appendChild(myDiv);
490488

491489
this.reactRoot = createRoot(myDiv);

js/dataframe/styles.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
height: 500px;
4242
&:not(.scrolling) {
4343
height: auto;
44-
flex-basis: 500px;
4544
}
4645

4746
> table {
@@ -203,3 +202,9 @@
203202
}
204203
}
205204
}
205+
206+
/* Center the table when inside of a card */
207+
.card-body .shiny-data-grid {
208+
margin-left: auto;
209+
margin-right: auto;
210+
}

0 commit comments

Comments
 (0)