poemsforaphrodite commited on
Commit
07135b6
1 Parent(s): f4ca6bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -489,10 +489,14 @@ def show_tabular_data(df, co):
489
  return base_url + path[:max_length - len(base_url) - 3] + '...'
490
  return base_url + path
491
 
 
 
 
 
492
  # Display each row
493
  for index, row in df.iloc[start_idx:end_idx].iterrows():
494
  cols = st.columns([3, 2, 1, 1, 1, 1, 1, 1])
495
- cols[0].write(truncate_url(row['page']))
496
  cols[1].write(row['query'])
497
  cols[2].write(row['clicks'])
498
  cols[3].write(row['impressions'])
 
489
  return base_url + path[:max_length - len(base_url) - 3] + '...'
490
  return base_url + path
491
 
492
+ def make_clickable(url):
493
+ truncated_url = truncate_url(url)
494
+ return f'<a href="{url}" target="_blank">{truncated_url}</a>'
495
+
496
  # Display each row
497
  for index, row in df.iloc[start_idx:end_idx].iterrows():
498
  cols = st.columns([3, 2, 1, 1, 1, 1, 1, 1])
499
+ cols[0].markdown(make_clickable(row['page']), unsafe_allow_html=True)
500
  cols[1].write(row['query'])
501
  cols[2].write(row['clicks'])
502
  cols[3].write(row['impressions'])