streamlit 라이브러리에 html&css코드 적용시키기
1. 쌍따옴표 3개 안에 원하는 html&css코드를 넣어준 뒤, [html_css]라고 정의해준다.
2. streamlit의 markdown 함수로 [html_css]를 실행한다.
html_css = """
<style>
table.customTable {
width: 100%;
background-color: #FFFFFF;
border-collapse: collapse;
border-width: 2px;
border-color: #7EA8F8;
border-style: solid;
color: #000000;
}
</style>
<table class="customTable">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
<td>Row 1, Cell 3</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
<td>Row 2, Cell 3</td>
</tr>
<tr>
<td>Row 3, Cell 1</td>
<td>Row 3, Cell 2</td>
<td>Row 3, Cell 3</td>
</tr>
<tr>
<td>Row 4, Cell 1</td>
<td>Row 4, Cell 2</td>
<td>Row 4, Cell 3</td>
</tr>
</tbody>
</table>
"""
st.markdown(html_css)
'programming > Python' 카테고리의 다른 글
[파이썬] Streamlit을 이용한 간단한 웹 애플리케이션 개발 (0) | 2023.12.26 |
---|---|
[파이썬] streamlit에 JS코드 적용하기 (0) | 2023.12.26 |
파이썬 selenium 라이브러리 ChromeOptions 총정리 (0) | 2023.09.01 |
파이썬 가상환경에서 실행파일 만들기 (0) | 2023.08.29 |
PyInstaller를 이용한 실행 파일(exe) 만들기 (0) | 2023.08.22 |