Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy a sample Shiny app that uses ITables #276

Open
mwouts opened this issue May 27, 2024 · 4 comments
Open

Deploy a sample Shiny app that uses ITables #276

mwouts opened this issue May 27, 2024 · 4 comments

Comments

@mwouts
Copy link
Owner

mwouts commented May 27, 2024

This can be done using https://shiny.posit.co/py/docs/shinylive.html.

See also https://www.appsilon.com/post/shiny-for-python-deploy-github-pages

@fredguth
Copy link

I have a working example here: https://github.com/fredguth/shinyduck/blob/main/express-itables-mwe.py

@micboat
Copy link

micboat commented Sep 14, 2024

@fredguth thanks for sharing. If I have a custom css. how do I apply it to the itable output within my shiny express app.

.dt-container {
  font-size: small;
}

.dataTable th {
  font-weight: bolder;
  background-color: #e1e6ec;
  color: #120051;
  text-align: center !important;
}

.dataTable tbody {
  background-color: white;
  color: #120051;
}

/* Left-align the first visible column (index) */
.dataTable td:first-child,
.dataTable th:first-child {
  text-align: left !important;
}

/* Center-align all other columns */
.dataTable td:not(:first-child),
.dataTable th:not(:first-child) {
  text-align: center !important;
}
"""

often within ipython notebooks I can do this to apply to all tables

from IPython.core.display import display, HTML
display(HTML(f"<style>{css}</style>" ""))

@sidviny
Copy link

sidviny commented Sep 16, 2024 via email

@mwouts
Copy link
Owner Author

mwouts commented Sep 23, 2024

@micboat to include your custom css, you could save it under custom.css then add this to your app:

ui.include_css(Path(__file__).parent / "custom.css")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants