'Args:
data (str): The un-padded data of the entry.
Kwargs:
width (int): Desired width of cell. It will pad
to this size.
height (int): Desired height of cell. it will pad
to this size.
pad_width (int): General padding width. This can be overruled
by individual settings below.
pad_left (int): Number of extra pad characters on the left.
pad_right (int): Number of extra pad characters on the right.
pad_top (int):  Number of extra pad lines top (will pad with `vpad_char`).
pad_bottom (int): Number of extra pad lines bottom (will pad with `vpad_char`).
pad_char (str)- pad character to use for padding. This is overruled
by individual settings below (default `" "`).
hpad_char (str): Pad character to use both for extra horizontal
padding (default `" "`).
vpad_char (str): Pad character to use for extra vertical padding
and for vertical fill (default `" "`).
fill_char (str): Character used to filling (expanding cells to
desired size). This can be overruled by individual settings below.
hfill_char (str): Character used for horizontal fill (default `" "`).
vfill_char (str): Character used for vertical fill (default `" "`).
align (str): Should be one of "l", "r" or  "c" for left-, right- or center
horizontal alignment respectively. Default is left-aligned.
valign (str): Should be one of "t", "b" or "c" for top-, bottom and center
vertical alignment respectively. Default is centered.
border_width (int): General border width. This is overruled
by individual settings below.
border_left (int): Left border width.
border_right (int): Right border width.
border_top (int): Top border width.
border_bottom (int): Bottom border width.
border_char (str): This will use a single border char for all borders.
overruled by individual settings below.
border_left_char (str): Char used for left border.
border_right_char (str): Char used for right border.
border_top_char (str): Char used for top border.
border_bottom_char (str): Char user for bottom border.
corner_char (str): Character used when two borders cross.  (default is "").
This is overruled by individual settings below.
corner_top_left_char (str): Char used for "nw" corner.
corner_top_right_char (str):  Char used for "ne" corner.
corner_bottom_left_char (str): Char used for "sw" corner.
corner_bottom_right_char (str): Char used for "se" corner.
crop_string (str): String to use when cropping sideways, default is `\'[...]\'`.
crop (bool): Crop contentof cell rather than expand vertically, default=`False`.
enforce_size (bool): If true, the width/height of the cell is
strictly enforced and extra text will be cropped rather than the
cell growing vertically.
Raises:
Exception: for impossible cell size requirements where the
border width or height cannot fit, or the content is too
small.'

def __init__(self, data, **kwargs):

    self.formatted = None
    padwidth = kwargs.get('pad_width', None)
    padwidth = (int(padwidth) if (padwidth is not None) else None)
    self.pad_left = int(kwargs.get('pad_left', (padwidth if (padwidth is not None) else 1)))
    self.pad_right = int(kwargs.get('pad_right', (padwidth if (padwidth is not None) else 1)))
    self.pad_top = int(kwargs.get('pad_top', (padwidth if (padwidth is not None) else 0)))
    self.pad_bottom = int(kwargs.get('pad_bottom', (padwidth if (padwidth is not None) else 0)))
    self.enforce_size = kwargs.get('enforce_size', False)
    pad_char = kwargs.get('pad_char', '    ')
    pad_char = (pad_char[0] if pad_char else '    ')
    hpad_char = kwargs.get('hpad_char', pad_char)
    self.hpad_char = (hpad_char[0] if hpad_char else pad_char)
    vpad_char = kwargs.get('vpad_char', pad_char)
    self.vpad_char = (vpad_char[0] if vpad_char else pad_char)
    fill_char = kwargs.get('fill_char', '    ')
    fill_char = (fill_char[0] if fill_char else '    ')
    hfill_char = kwargs.get('hfill_char', fill_char)
    self.hfill_char = (hfill_char[0] if hfill_char else '    ')
    vfill_char = kwargs.get('vfill_char', fill_char)
    self.vfill_char = (vfill_char[0] if vfill_char else '    ')
    self.crop_string = kwargs.get('crop_string', '[...]')
    borderwidth = kwargs.get('border_width', 0)
    self.border_left = kwargs.get('border_left', borderwidth)
    self.border_right = kwargs.get('border_right', borderwidth)
    self.border_top = kwargs.get('border_top', borderwidth)
    self.border_bottom = kwargs.get('border_bottom', borderwidth)
    borderchar = kwargs.get('border_char', None)
    self.border_left_char = kwargs.get('border_left_char', (borderchar if borderchar else '|'))
    self.border_right_char = kwargs.get('border_right_char', (borderchar if borderchar else '|'))
    self.border_top_char = kwargs.get('border_topchar', (borderchar if borderchar else '-'))
    self.border_bottom_char = kwargs.get('border_bottom_char', (borderchar if borderchar else '-'))
    corner_char = kwargs.get('corner_char', '+')
    self.corner_top_left_char = kwargs.get('corner_top_left_char', corner_char)
    self.corner_top_right_char = kwargs.get('corner_top_right_char', corner_char)
    self.corner_bottom_left_char = kwargs.get('corner_bottom_left_char', corner_char)
    self.corner_bottom_right_char = kwargs.get('corner_bottom_right_char', corner_char)
    self.align = kwargs.get('align', 'l')
    self.valign = kwargs.get('valign', 'c')
    self.data = self._split_lines(_to_ansi(data))
    self.raw_width = max((m_len(line) for line in self.data))
    self.raw_height = len(self.data)
    self.trim_horizontal = 0
    self.trim_vertical = 0
    if ('width' in kwargs):
        width = kwargs.pop('width')
        self.width = ((((width - self.pad_left) - self.pad_right) - self.border_left) - self.border_right)
        if (self.width <= 0 < self.raw_width):
            raise Exception('Cell    width    too    small    -    no    space    for    data.')
    else:
        self.width = self.raw_width
    if ('height' in kwargs):
        height = kwargs.pop('height')
        self.height = ((((height - self.pad_top) - self.pad_bottom) - self.border_top) - self.border_bottom)
        if (self.height <= 0 < self.raw_height):
            raise Exception('Cell    height    too    small    -    no    space    for    data.')
    else:
        self.height = self.raw_height
