code: def _pad_string(self, str, colwidth):
          
          width = self._disp_width(str)
          prefix = (colwidth - 1 - width) // 2
          suffix = colwidth - prefix - width
          return ' ' * prefix + str + ' ' * suffix
docs: Center-pads a string to the given column width using spaces.