def METHOD_NAME(datalist, ncols):
    """Build a Markdown table-grid for compact display"""
    nlen = len(datalist)
    table_heading = "| " * (ncols) + "|"
    table_sep = "|---" * (ncols) + "|"
    table = ""
    for ir in range(0, nlen, ncols):
        table += "| " + " | ".join(datalist[ir : ir + ncols]) + " |\n"
    return f"{table_heading}\n{table_sep}\n{table}"