Jan-16-2019, 04:48 PM
Hello,
Brand new to posting in this forum so hello all.
I do not seem to be able to increase the width of the output from an sQlite3 DB table.
The output is delivered in full, and I am clueless as to how to change it.
I'm sure the solution is straightforward. Too much of a newbie... any help very gratefully received.
This is my current output:
My current output
Brand new to posting in this forum so hello all.
I do not seem to be able to increase the width of the output from an sQlite3 DB table.
The output is delivered in full, and I am clueless as to how to change it.
I'm sure the solution is straightforward. Too much of a newbie... any help very gratefully received.
This is my current output:
My current output
def showCustTable():
showCustTableWin=Tk()
showCustTableWin.title("* Customer Table *")
showCustTableWin.geometry("850x350")
showCustTableWin.wm_iconbitmap('favicon.ico')
def View():
myshop_db = sqlite3.connect("myshop_db.db")
c = myshop_db.cursor()
c.execute('''SELECT * FROM Customers''')
rows = c.fetchall()
for row in rows:
tree.insert("",tk.END, values = row)
myshop_db.commit()
myshop_db.close()
frame1 = Frame(showCustTableWin, width=850, height=350,bd=15,relief="raise")
frame1.pack()
tree= ttk.Treeview(frame1, column=("column1", "column2", "column3", "column4", "column5", "column6", "column7"), show='headings')
tree.heading("#1", text="CUST#")
tree.column("#1", width = 5, anchor = "w")
tree.heading("#2", text="NAME")
tree.column("#2", width = 25, anchor = "w")
tree.heading("#3", text="ADDRESS")
tree.column("#3", width = 30, anchor = "w")
tree.heading("#4", text="CITY")
tree.column("#4", width = 15, anchor = "w")
tree.heading("#5", text="POSTCODE")
tree.column("#5", width = 15, anchor = "w")
tree.heading("#6", text="TEL")
tree.column("#6", width = 15, anchor = "w")
tree.heading("#7", text="EMAIL")
tree.column("#7", width = 35, anchor = "w")
tree.pack()
View()
Again, thank you very much in advance for having a look. :)
