code: def prettytable(self):
          
          table = prettytable.PrettyTable(self.columns)
  
          if self.sortby:
              if self.sortby in self.columns:
                  table.sortby = self.sortby
              else:
                  msg = "Column (%s) doesn't exist to sort by" % self.sortby
                  raise exceptions.CLIAbort(msg)
          for a_col, alignment in self.align.items():
              table.align[a_col] = alignment
  
          if self.title:
              table.title = self.title
          # Adding rows
          for row in self.rows:
              table.add_row(row)
          return table
docs: Returns a new prettytable instance.