Pads a string

@param {*} data The text to pad
@param {Number} length The padded length
@param {String?} pad The text to pad with, default is space
@returns {String}
function pad(data, length, pad) {
    data = String(data);
    pad = pad || ' ';
    while (data.length < length) data += pad;
    return data;
}