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

Render unfiltered HTML table prior to loading JS/CSS resources #349

Open
liquidcarbon opened this issue Jan 16, 2025 · 2 comments
Open

Render unfiltered HTML table prior to loading JS/CSS resources #349

liquidcarbon opened this issue Jan 16, 2025 · 2 comments

Comments

@liquidcarbon
Copy link

I have a bunch of APIs that serve minimal webpages with itables in them.

Up to a certain point, curl-ing these endpoints would return a usable HTML table with all rows, which on loading the scripts would get styled and sliced into pages. It was very important to have the full table available, as I could read those endpoints using pd.read_html or using other software capable of parsing HTML tables (specifically, JMP).

Now, the table body only displays Loading ITables v2.2.4 from the internet...; the data is there in JS code and the pages load as expected in browser, but not through curl or pd.read_html.

Is there a way to make the full HTML table available again?

@liquidcarbon liquidcarbon changed the title Render HTML table prior to loading JS/CSS resources Render unfiltered HTML table prior to loading JS/CSS resources Jan 16, 2025
@liquidcarbon
Copy link
Author

liquidcarbon commented Jan 16, 2025

This seems to be working - may be useful to document?

from itables.utils import UNPKG_DT_BUNDLE_URL_NO_VERSION
html_table = to_html_datatable(
    df,
    autoWidth=False,
    # connected = False  # doesn't seem to make a difference
    use_to_html = True  # returns full table but remains unstyled and non-interactive
    dt_url = UNPKG_DT_BUNDLE_URL_NO_VERSION  # until you supply this kwarg
)
return f"<div>{html_table}</div>"

@liquidcarbon
Copy link
Author

liquidcarbon commented Jan 16, 2025

maybe spoke too soon - still need help

const data array is now gone; and this appears

Image

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

1 participant