<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __print_table(self, row_delim, header_delim=None, header_pad=u"", pad=u""):
 """ row_delim default delimiter inserted between columns of every row in the table. header_delim delimiter inserted within the headers. by default takes the value of `row_delim` header_pad put on the sides of the row of headers. pad put on the sides of every row. """

        if header_delim is None:
            header_delim = row_delim
        num_cols = len(self.fields)
        accumulator = ((u"%s" + header_delim) * num_cols)[:-len(header_delim)]
        accumulator = ((header_pad + accumulator + header_pad + u"\n") %
                       tuple(self.fields))
        for datarow in self:
            rowstring = ((u"%s" + row_delim) * num_cols)[:-len(row_delim)]
            rowstring = (pad + rowstring + pad + u"\n") % tuple(datarow)
            accumulator += rowstring
        return accumulator[:-1]