def build_message(adds_table, adds_table_html, deletes_table, deletes_table_html,
                  company_name, email_adds=True, email_deletes=True):
    """
    Build the email message including added and removed jobs.

    :param adds_table: table of added jobs created from create_text_table
    :param adds_table_html: table of added jobs created from create_html_table
    :param deletes_table: table of deleted jobs created from create_text_table
    :param deletes_table_html: table of deleted jobs created from create_html_table
    :param company_name: name of company
    :param email_adds: True to include added jobs in the email
    :param email_deletes: True to include deleted jobs in the email
    :return: a plain-text email message and an HTML email message
    """
    text_msg = ""
    html_msg = ""

    if email_adds:
        text_msg += "\nNew jobs posted" + (" for " + company_name) * (company_name != "") + ":\n\n"
        text_msg += "{adds_table}\n\n"
        html_msg += "\n<p>New jobs posted" + (" for " + company_name) * (company_name != "") + ":</p>\n"
        html_msg += "{adds_html_table}\n"

    if email_deletes:
        text_msg += "\nJobs removed" + (" for " + company_name) * (company_name != "") + ":\n\n"
        text_msg += "{deletes_table}\n\n"
        html_msg += "\n<p>Jobs removed" + (" for " + company_name) * (company_name != "") + ":</p>\n"
        html_msg += "{deletes_html_table}\n"

    html_msg = "\n<html><body>" + html_msg + "</body></html>\n"

    html_msg = html_msg.format(adds_html_table=adds_table_html,
                               deletes_html_table=deletes_table_html)

    text_msg = text_msg.format(adds_table=adds_table,
                               deletes_table=deletes_table)

    # add horizontal padding to table to make it look nicer
    html_msg = html_msg.replace('<html>',
                                '<html>\n<head>\n<style>\ntable {\n\tborder-spacing: 10px 0;\n}\n</style>\n</head>\n')

    return text_msg, html_msg