Use the code below to add the following features to it: - Add features to the table function to turn
This problem has been solved!
Do you need an answer to a question different from the above? Ask your question!
Question:
Use the code below to add the following features to it:
- Add features to the table function to turn it into a table object.
- Your table object should store properties like row_count, column_count, and border_size.
- Your table object should have methods like add_row() and delete_row().
- You should be able to create a table of arbitrary size by calling your object's constructor.
Code
def Table(rows, columns):
html_code = "
row_count = 1
while row_count <= rows:
html_code += ""
col_count = 1
while col_count <= columns:
html_code += ""
col_count += 1
html_code += ""
row_count += 1
html_code += "
" + input("Enter data for cell " + str(row_count) + "," + str(col_count) + ": ") + " |
return html_code
rows = int(input("How many rows: "))
columns = int(input("How many columns: "))
html_table = Table(rows, columns)
with open("index.html", "w") as f:
f.write(html_table)
import webbrowser
webbrowser.open("index.html")
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
View Solution
Create a free account to access the answer
Cannot find your solution?
Post a FREE question now and get an answer within minutes.
* Average response time.
Posted Date: September 05, 2023 01:14:29