I am trying to add the web URL to the prettytable of python and generate this in an HTML table... As I am a Linux user, the terminal automatically detects the link present in the table but it is not in the case of HTML ...
and also I am trying to use the same to generate a hyperlink in the table... but I was not able to do it as I am getting many blockages...
my code to generate prettytable in python
diff_table = PrettyTable(["S.NO"," Commit Message", "Author", 'URL','Date','Time'])
for commit in response_differneces_in_json['commits']:
url = commit['web_url']
diff_table.add_row([count , commit['title'] , commit['author_name'], "<a href="+url+">click here</a>" ,commit['committed_date'][:10],commit['committed_date'][11:19]])
text = diff_table.get_html_string(format=True)
text = html.unescape(text)
count = count + 1
#here imported the html module
here I am getting output as the same string as click here
and I am generating the html report for this table by :
f.write('<p>'+diff_table.get_html_string()+'</p>')
Here I cannot make a link clickable and how to make the link clickable in Html format and also how to create a hyperlink
or is that possible to manipulate all the columns of the HTML table --> to make it clickable?