From the course: Advanced Hands-On Python: Working with Excel and Spreadsheet Data

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Creating an Excel table

Creating an Excel table

- [Instructor] Excel tables are a common way of organizing and formatting data in a spreadsheet to make analyzing the data easier. And in this example, we're going to see how to create an Excel table using XLSXWriter. And we're going to build on our previous formatting examples. So if you haven't already done that one, I would suggest going back and doing it. So, let's go ahead and open up our XLSX tables file. Right, so here in the example file, I already have some code that creates the workbook and defines some formatting and then adds the data to the worksheet. So, to create an Excel table, I need to first define some table options and then create the region that represents the table. So first, let's create the object that will define the table options. And I'll call that "table_options". And for the moment, I'll just specify the table name. To define the table, I'll use the add table function, which requires me to specify the region of the worksheet that represents the table. And…

Contents