def convert_to_html(model):
    """
    Takes a model instance and produces an HTML table that represents the
    results in a nice way for us to look at.

    Parameters
    ----------
    model : dict
    Dictionary of layers and their properties as a list in the form of
    [Vp, Vs, rho, thickness, top]

    Returns
    -------
    html_str : str
    Nicely formatted HTML table of the model results.
    """

    layer_labels = ["Water", "Ice", "Upper_Seds.", "Middle_Seds.",
                    "Lower_Seds.", "Upper_Crust", "Middle_Crust",
                    "Lower_Crust", "Mantle"]
    header = ["Type", "Vp", "Vs", "Density", "Thickness", "Top"]

    layer_names = ["water", "ice", "upper_sediments",
                   "middle_sediments", "lower_sediments",
                   "upper_crust", "middle_crust", "lower_crust", "mantle"]

    # Make the table with HTML
    html_str = "<table width=\"350\" border=\"1\">\n"
    html_str += "\t<tr>"

    # Header row
    for h in header:
        html_str += "\t\t<td>%s</td>\n" % h
    html_str += "\t</tr>\n"

    # Row for each layer (if it exists)
    for i, layer in enumerate(layer_names):
        if layer in model:
            # Layer label in first column
            html_str += "\t<tr>\n"
            html_str += "\t\t<td>%s</td>\n" % layer_labels[i]

            # Get and write layer data
            row = model[layer]
            for item in row:
                html_str += "\t\t<td>%s</td>\n" % item

            html_str += "\t</tr>\n"

    # Close table
    html_str += "</table>\n"

    return html_str