sbi-rviot/ph_table

how to format object<class 'pandas.io.formats.style.Styler'> via pretty_html_table?

yuzhujiutian opened this issue · 1 comments

or pretty_html_table can add hyperlink clickable?


Scene:

step 0: pd table, without hyperlink

0 1 2 3
100_hypterlink -0.356415 -0.494983 -0.231265
-0.780016 -1.25449 -0.64094 0.817745
-1.232963 -0.021775 -0.72884 -0.48305
200_hyperlink -0.201484 1.718063 0.546134
-0.947987 0.334248 -0.09831 0.576782
-0.179836 -0.438306 -0.347648 1.798265
1.730846 2.63108 1.95353 -1.35487
-0.775219 0.83043 -0.563685 -0.753101
-1.492496 -0.281578 -0.467912 0.887825
0.010856 -0.414896 -0.426839 0.262305

step 1: add hyperlink
add clickable hyperlink in pandas dataframe. e.g. link

step 2: pretty html
then with pretty_html_table to render the pd with hyperlink

0 1 2 3
100_hypterlink -0.356415 -0.494983 -0.231265
-0.780016 -1.25449 -0.64094 0.817745
-1.232963 -0.021775 -0.72884 -0.48305
200_hyperlink -0.201484 1.718063 0.546134
-0.947987 0.334248 -0.09831 0.576782
-0.179836 -0.438306 -0.347648 1.798265
1.730846 2.63108 1.95353 -1.35487
-0.775219 0.83043 -0.563685 -0.753101
-1.492496 -0.281578 -0.467912 0.887825
0.010856 -0.414896 -0.426839 0.262305

Expected effect:(as shown in the following figure)
image

Hello,
would you be able to try it starting with building the href in the table and then using pretty_table?