docs: def _place_rows_and_render_borders(container, rendered_rows):
          """Place the rendered cells onto the page canvas and draw borders around
          them."""
          def draw_cell_border(rendered_cell, cell_height, container):
              cell_width = rendered_cell.width
              background = TableCellBackground((0, 0), cell_width, cell_height,
                                               parent=rendered_cell.cell)
              background.render(container)
              for position in ('top', 'right', 'bottom', 'left'):
                  border = TableCellBorder(rendered_cell, cell_height, position)
                  border.render(container)
              return background
  
          y_cursor = container.cursor
          for r, rendered_row in enumerate(rendered_rows):
              container.advance(rendered_row.height)
              if rendered_row.index == 0:
                  container.register_styled(rendered_row.row.section)
              container.register_styled(rendered_row.row)
              for c, rendered_cell in enumerate(rendered_row):
                  cell_height = sum(rendered_row.height for rendered_row in
                                    rendered_rows[r:r + rendered_cell.rowspan])
                  x_cursor = rendered_cell.x_position
                  y_pos = float(y_cursor + cell_height)
                  cell_container = VirtualContainer(container)
                  background = draw_cell_border(rendered_cell, cell_height,
                                                cell_container)
                  cell_container.place_at(container, x_cursor, y_pos)
                  vertical_align = rendered_cell.cell.get_style('vertical_align',
                                                                container)
                  if vertical_align == VerticalAlign.TOP:
                      vertical_offset = 0
                  elif vertical_align == VerticalAlign.MIDDLE:
                      vertical_offset = (cell_height - rendered_cell.height) / 2
                  elif vertical_align == VerticalAlign.BOTTOM:
                      vertical_offset = (cell_height - rendered_cell.height)
                  y_offset = float(y_cursor + vertical_offset)
                  rendered_cell.container.place_at(container, x_cursor, y_offset)
                  container.register_styled(background)
              y_cursor += rendered_row.height