According the xlsxwriter Documentation Section covering the .add_table() method, it expects that "the data structure should be an list of lists" (link to docs).
To create this list of lists from your dataframe, it will be necessary to use .T to transpose the dataframe and then .tolist() to convert the transposed dataframe into a list of lists.
I have a fully reproducible example using a sample dataframe below.
import pandas as pd
import xlsxwriter
data = pd.DataFrame({'a':[1,2,3,4,5],
'b':[2,3,4,5,6],
'c':[3,4,5,6,7],
'd':[4,5,6,7,8],
'e':[5,6,7,8,9]})
workbook = xlsxwriter.Workbook("test1.xlsx")
worksheet = workbook.add_worksheet("sheli22")
worksheet.add_table('B3:F7', {'data': data.values.T.tolist(),'style': 'Table Style Light 17','header_row': False})
workbook.close()
With Expected Output:
