def _get_span_tag(df, tag_data, stack_data) -> str:
    """Gets the appropriate tag for a span from either the column header or cell."""
    if tag_data:
        if tag_data[0] == "column_data":
            return df[tag_data[1]][stack_data[1]]
        elif tag_data == "column_header":
            return str(stack_data[2])
    return ""