There's no way to add another element, like the Checkbox, into the PySimpleGUI Table.
Following code demo a way to simulate the action.
import PySimpleGUI as sg
check = "✔" # ✓✔✅✘❌✖✕❎☓✗
headings = ['President', 'Date of Birth', 'LEN 1', 'LEN 2', 'LEN 3']
data = [
['Ronald Reagan', 'February 6'],
['Thomas Jefferson', 'April 13'],
['George W. Bush', 'July 6'],
['John Quincy Adams', 'July 11'],
['Jimmy Carter', 'October 1'],
['John Adams', 'October 30'],
['Frank Underwood', 'November 5'],
['Woodrow Wilson', 'December 28'],
]
data = [[name, birthday, str(len(name)), str(len(birthday)), str(len(name+birthday))] for name, birthday in data]
col_widths = list(map(lambda y:max(y)+2, map(lambda x:map(len, x), zip(*([headings] + data)))))
font = ('Courier New', 16, 'bold')
sg.theme('LightPurple')
sg.set_options(font=font)
layout = [
[sg.Table(
data, headings=headings, auto_size_columns=False, col_widths=col_widths,
num_rows=10, cols_justification="llccc", enable_click_events=True,
key='-TABLE-', metadata=[])],
[sg.Button('Quit')]
]
window = sg.Window('Checkable Table', layout, finalize=True)
table = window["-TABLE-"]
while True:
event, values = window.read()
if event in (sg.WIN_CLOSED, 'Quit'):
break
elif isinstance(event, tuple) and event[:2]==('-TABLE-', '+CLICKED+'):
row, column = event[-1]
if row == -1:
if column in table.metadata:
table.metadata.remove(column)
table.widget.heading(column, text=headings[column])
else:
table.metadata.append(column)
table.widget.heading(column, text=check+headings[column])
window.close()
