def studies_to_html_table(studies):
    """Transform DataFrame of similar studies to an HTML table.

    Parameters
    ----------
    studies : pandas DataFrame, as returned by
        `NeuroQueryImageSearch()(img)["studies"]`

    Returns
    -------
    table : a `str` containing an HTML table.

    """
    studies["Title"] = [
        f"<a href='{link}' target='_blank'>{text}</a>"
        for link, text in studies.loc[:, ["pubmed_url", "title"]].values
    ]
    studies = studies.loc[
        :, ["Title", "similarity", "pmid", "title", "pubmed_url"]
    ]
    studies.rename(columns={"similarity": "Similarity"}, inplace=True)
    table = (
        studies.style.bar(
            subset=["Similarity"], color="lightgreen", width=98, vmin=0.0
        )
        .hide_index()
        .hide_columns(["pmid", "title", "pubmed_url"])
        .format({"Similarity": "{:.2f}"})
        .set_table_attributes('class="studies-table"')
        .render()
    )
    return table