Use html button within table as a native one

I have the following html code of a table, embedded within a Streamlit app:

homepage_table = """

<p>\n</p>
<p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n</p>
<table id="T_e352c_" style="height: 152px; width: 467.281px;">
<thead>
<tr>
<th class="col_heading level0 col0" style="width: 56px;">Status</th>
<th class="col_heading level0 col1" style="width: 219px;">Product</th>
<th class="col_heading level0 col2" style="width: 71px;">Impact</th>
<th class="col_heading level0 col4" style="width: 82.2812px;">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td id="T_e352c_row0_col0" class="data row0 col0" style="width: 56px; text-align: center;">⚠️</td>
<td id="T_e352c_row0_col1" class="data row0 col1" style="width: 219px; text-align: left;">Product A;</td>
<td id="T_e352c_row0_col2" class="data row0 col2" style="width: 71px; text-align: left;">&euro; 1.520</td>
<td id="T_e352c_row0_col4" class="data row0 col4" style="width: 82.2812px; text-align: center;"><button class="css-160hik1 edgvbvh1">Go</button></td>
</tr>

"""

That renders as you can see below; I would like to use the button within the html code as a normal Streamlit button ( st.button() ) so that, whenever it’s clicked, I can run some additional code:

e.g.

if st.button("my_html_button"):
   st.write("It works!"

enter image description here

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.