There isn’t a supported way to get the ID of the current column, but there is a hacky way that happens to work today:
table.table._engine._current_node.col_id
The downside is that it peeks into the internals of the data engine, so there is no guarantee it will continue working in future versions of the code.