I have seen some related questions but I could not find a minimal reproducible example that helps in my basic case.
Let us say I have a simple table with a multicolumn. The code is as follows
\documentclass[a4paper]{article}
\begin{document}
\begin{table}
\begin{tabular}{| c | c |}
\multicolumn{2}{|c|}{Header text}\\
A & B\\
C & D\\
\end{tabular}
\end{table}
\end{document}
and this is the output
I would expect A, B, C, D to be horizontally centered, but they are not. What is the simplest way to achieve this?

tabular*– David Carlisle Mar 12 '20 at 10:44\halignwith spanned cells is really unhelpful here so "doing what you want" and "staying vaguely compatible with existing latex table macros" is harder than you might hope. – David Carlisle Mar 12 '20 at 11:23