import aspose.words as aw # Load the license wordToTiff = aw.License() wordToTiff.set_license("Aspose.Total.lic") # Instantiate DocumentBuilder object to create a table forAddingTableInWord = aw.DocumentBuilder() # Start the table tableInWord = forAddingTableInWord.start_table() # Insert a cell in the newly created table forAddingTableInWord.insert_cell() # Set some text in the cell forAddingTableInWord.write("Sample data for Table Row 1 and Cell 1") # Insert another cell in the same row forAddingTableInWord.insert_cell() # Insert image forAddingTableInWord.insert_image("SampleImage.jpg") # End the row forAddingTableInWord.end_row() # End the table forAddingTableInWord.end_table() # Save the output Word file with a table forAddingTableInWord.document.save("WorFileWithTable.docx") print ("Word file with a table created successfully")