布局:
data_values = []
data_headings = ['File ID', 'Type', 'Description', 'Remarks']
data_values.append(['', '', '', ''])
data_cols_width = [5, 8, 35, 35]
tab5_layout = [
[sg.Table(values=data_values, headings=data_headings,
max_col_width=65,
col_widths=data_cols_width,
auto_size_columns=False,
justification='left',
num_rows=6, key='_filestable_')],
[sg.Button('Select Row', key='_rowselected_')]
事件:
if event == '_rowselected_':
te1 = values['_filestable_']
print('Event triggered : ', te1)