Tkinter Wiki   Table UserPreferences
 
HelpContents FindPage Diffs Info Edit Subscribe XML Print View

The PmwContribD Table is a widget for displaying tabular data.

  1 
  2 
  3 
  4 
  5 
  6 
  7 
  8 
  9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 18 
 19 
 20 
            self.table = Table(self.interior(), cellpadding=pad, xfreeze=1)
            self.table.addcolumn( RowLabelColumn(
                title='',
                datasource=TestDataSource(),
                width=50,
                rowheight=rowheight,
                cellalignment='se',
                cellpadding=pad,
                ))
            for i in range(10):
                self.table.addcolumn( Column(
                    title='Col %d' % i,
                    datasource=TestDataSource(base=10**i),
                    #width=50 + (10 * i),
                    width=0,
                    rowheight=rowheight,
                    cellalignment='se',
                    cellpadding=pad,
                    ) )
                self.table.pack(fill=Tkinter.BOTH, expand=Tkinter.YES)

Screenshot:

table.png

PythonPowered