Spaces:
Runtime error
Runtime error
Tyler Burns
commited on
Commit
·
376af7a
1
Parent(s):
142c783
testing another make clickable option
Browse files- app.py +9 -10
- flycheck_app.py +9 -10
app.py
CHANGED
@@ -75,16 +75,15 @@ dat['body'] = [re.sub('<br>', ' ', i) for i in dat['body']]
|
|
75 |
st.caption('Click on the table and press ctrl+f (or command+f for mac) to search it')
|
76 |
|
77 |
# Make the link clickable
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
return f'<a target="_blank" href="{
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
dat
|
87 |
-
# st.write(dat, unsafe_allow_html=True)
|
88 |
|
89 |
# Place a table under the plot
|
90 |
st.dataframe(dat)
|
|
|
75 |
st.caption('Click on the table and press ctrl+f (or command+f for mac) to search it')
|
76 |
|
77 |
# Make the link clickable
|
78 |
+
# pandas display options
|
79 |
+
pd.set_option('display.max_colwidth', -1)
|
80 |
+
|
81 |
+
def make_clickable(url, text):
|
82 |
+
return f'<a target="_blank" href="{url}">{text}</a>'
|
83 |
+
|
84 |
+
dat['href'] = dat['href'].apply(make_clickable, args = ('Click',))
|
85 |
+
|
86 |
+
st.write(dat.to_html(escape = False), unsafe_allow_html = True)
|
|
|
87 |
|
88 |
# Place a table under the plot
|
89 |
st.dataframe(dat)
|
flycheck_app.py
CHANGED
@@ -75,16 +75,15 @@ dat['body'] = [re.sub('<br>', ' ', i) for i in dat['body']]
|
|
75 |
st.caption('Click on the table and press ctrl+f (or command+f for mac) to search it')
|
76 |
|
77 |
# Make the link clickable
|
78 |
-
|
79 |
-
|
80 |
-
# extract clickable text to display for your link
|
81 |
-
text = link.split('=')[1]
|
82 |
-
return f'<a target="_blank" href="{link}">{text}</a>'
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
88 |
|
89 |
# Place a table under the plot
|
90 |
-
|
|
|
75 |
st.caption('Click on the table and press ctrl+f (or command+f for mac) to search it')
|
76 |
|
77 |
# Make the link clickable
|
78 |
+
# pandas display options
|
79 |
+
pd.set_option('display.max_colwidth', -1)
|
|
|
|
|
|
|
80 |
|
81 |
+
def make_clickable(url, text):
|
82 |
+
return f'<a target="_blank" href="{url}">{text}</a>'
|
83 |
+
|
84 |
+
dat['href'] = dat['href'].apply(make_clickable, args = ('Click',))
|
85 |
+
|
86 |
+
st.write(dat.to_html(escape = False), unsafe_allow_html = True)
|
87 |
|
88 |
# Place a table under the plot
|
89 |
+
st.dataframe(dat)
|