how to write a list of data in HTML table using python
-
I have build up a HTML table and want to write data using python code. Here is the code: <body> <h1 align="center">EXAMPLE</h1> <table style="width:100%"> <tr> <th width="17%" height="70">XYZ</th> <th width="37%">XYZ</th> <th width="16%">XYZ</th> <th width="16%">XYZ</th> <th width="14%">XYZ</th> </tr> </table> I want to enter the table data using strings and using python code. Is it possible to enter the data?? *Here these XYZ values shall be replaced by using string.
-
Answer:
May be this helps my_string = 'whatever you want' with open('my.html') as html: html_data = html.read() with open('new.html', 'w') as new_html: new_html.write(html_data.replace('XYZ', my_string))
user5241812 at Stack Overflow Visit the source
Related Q & A:
- How To Write A Resume?Best solution by Yahoo! Answers
- How To Write A Letter?Best solution by Yahoo! Answers
- How to add a column header to the dynamic table?Best solution by stackoverflow.com
- How to add a list to the existing list jQuery?Best solution by designchemical.com
- How to write a persuasive letter to a bank?Best solution by wikihow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.