jeeva780 commited on
Commit
ea76dbf
·
verified ·
1 Parent(s): e6c12bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -21
app.py CHANGED
@@ -1,26 +1,17 @@
1
  import streamlit as st
2
 
3
  # Define URLs
4
- url1 = "https://www.example1.com"
5
- url2 = "https://www.example2.com"
6
- url3 = "https://www.example3.com"
7
- url4 = "https://www.example4.com"
 
 
8
 
9
- # Embed URLs using iframes
10
- iframe1 = f'<iframe src="{url1}" width="800" height="600"></iframe>'
11
- iframe2 = f'<iframe src="{url2}" width="800" height="600"></iframe>'
12
- iframe3 = f'<iframe src="{url3}" width="800" height="600"></iframe>'
13
- iframe4 = f'<iframe src="{url4}" width="800" height="600"></iframe>'
14
 
15
- # Display iframes using Markdown
16
- st.markdown(f"### Layout 1")
17
- st.markdown(iframe1, unsafe_allow_html=True)
18
-
19
- st.markdown(f"### Layout 2")
20
- st.markdown(iframe2, unsafe_allow_html=True)
21
-
22
- st.markdown(f"### Layout 3")
23
- st.markdown(iframe3, unsafe_allow_html=True)
24
-
25
- st.markdown(f"### Layout 4")
26
- st.markdown(iframe4, unsafe_allow_html=True)
 
1
  import streamlit as st
2
 
3
  # Define URLs
4
+ urls = [
5
+ "https://www.example1.com",
6
+ "https://www.example2.com",
7
+ "https://www.example3.com",
8
+ "https://www.example4.com"
9
+ ]
10
 
11
+ # Create a 4x4 grid of iframes with no gaps
12
+ columns = st.beta_columns(4)
 
 
 
13
 
14
+ for i in range(4):
15
+ with columns[i]:
16
+ iframe_code = f'<iframe src="{urls[i]}" width="100%" height="400" style="border:0;"></iframe>'
17
+ st.markdown(iframe_code, unsafe_allow_html=True)