Skip to content

Commit

Permalink
Center table only when in card body; undo flex-basis
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Feb 23, 2024
1 parent f95e069 commit fd0c940
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 0 additions & 2 deletions js/dataframe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,6 @@ export class ShinyDataFrameOutput extends HTMLElement {

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

this.reactRoot = createRoot(myDiv);
Expand Down
7 changes: 6 additions & 1 deletion js/dataframe/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
height: 500px;
&:not(.scrolling) {
height: auto;
flex-basis: 500px;
}

> table {
Expand Down Expand Up @@ -203,3 +202,9 @@
}
}
}

/* Center the table when inside of a card */
.card-body .shiny-data-grid {
margin-left: auto;
margin-right: auto;
}
Loading

0 comments on commit fd0c940

Please sign in to comment.