'Horizontally center text on line of certain width, using padding.
Args:
text (str): The text to center.
width (int): How wide the area is (in characters) where `text`
should be centered.
pad_char (str): Which padding character to use.
Returns:
text (str): Centered text.'

def _center(self, text, width, pad_char):

    excess = (width - m_len(text))
    if (excess <= 0):
        return text
    if (excess % 2):
        narrowside = ((excess // 2) * pad_char)
        widerside = (narrowside + pad_char)
        if (width % 2):
            return ((narrowside + text) + widerside)
        else:
            return ((widerside + text) + narrowside)
    else:
        side = ((excess // 2) * pad_char)
        return ((side + text) + side)
