def _gen_table_cols(col_ids):
    """Generate Dash table columns in the expected format.

    :param col_ids: list of columns; must be in format <table-alias.name>,
                    like "s.serial_number", as in the SQL select statement
                    -- except for derived column values which must literally
                    use "alias." plus the name.
    :return: List of dictionaries, where each contains an 'id' and a 'name' key
             for a Dash DataTable.
    """
    col_list = []
    for col in col_ids:
        split_col = col.partition('.')
        if split_col[0] == 'alias':
            col_list.append({'id' : 'alias_{}'.format(split_col[2]),
                             'name' : split_col[2]})
        else:
            col_list.append({'id' : split_col[2], 'name' : split_col[2]})

    return col_list