Tyler Burns commited on
Commit
376af7a
·
1 Parent(s): 142c783

testing another make clickable option

Browse files
Files changed (2) hide show
  1. app.py +9 -10
  2. 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
- def make_clickable(link):
79
- # target _blank to open new window
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
- # link is the column with hyperlinks
85
- dat['href'] = dat['href'].apply(make_clickable)
86
- dat = dat.to_html(escape=False)
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
- def make_clickable(link):
79
- # target _blank to open new window
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
- # link is the column with hyperlinks
85
- dat['href'] = dat['href'].apply(make_clickable)
86
- dat = dat.to_html(escape=False)
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)