Skip to content

Commit a8a49e1

Browse files
author
Steve Canny
committed
tbl: refactor Table.cell()
1 parent 8a9fdfc commit a8a49e1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docx/table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def cell(self, row_idx, col_idx):
5858
Return |_Cell| instance correponding to table cell at *row_idx*,
5959
*col_idx* intersection, where (0, 0) is the top, left-most cell.
6060
"""
61-
row = self.rows[row_idx]
62-
return row.cells[col_idx]
61+
cell_idx = col_idx + (row_idx * self._column_count)
62+
return self._cells[cell_idx]
6363

6464
def column_cells(self, column_idx):
6565
"""

0 commit comments

Comments
 (0)