5. Let $a_{1}, a_{2}, \cdots, a_{6}$ be any permutation of $1,2, \cdots, 6$, and $f$ be a one-to-one mapping from $\{1,2, \cdots, 6\}$ to $\{1,2, \cdots, 6\}$, satisfying
$$
f(i) \neq i, f(f(i))=i(i=1,2, \cdots, 6) .
$$

Consider the number table
$$
A=\left[\begin{array}{cccccc}
a_{1} & a_{2} & a_{3} & a_{4} & a_{5} & a_{6} \\
f\left(a_{1}\right) & f\left(a_{2}\right) & f\left(a_{3}\right) & f\left(a_{4}\right) & f\left(a_{5}\right) & f\left(a_{6}\right)
\end{array}\right] .
$$

If the number tables $M$ and $N$ differ in at least one position, then $M$ and $N$ are considered two different number tables. The number of different number tables that satisfy the conditions is $\qquad$ (answer with a number).
5. 10800 .

For a permutation $a_{1}, a_{2}, \cdots, a_{6}$, consider the one-to-one mapping satisfying
$$
f(i) \neq i, f(f(i))=i(i=1,2, \cdots, 6)
$$

For each such mapping $f$, the elements of set $A$ can be paired as $\{i, j\}$, such that
$$
f(i)=j, f(j)=i \text {. }
$$

Thus, for each permutation, the number of mappings $f$ is equivalent to the number of ways to partition the set $\{1,2, \cdots, 6\}$ into three disjoint binary subsets. There are five elements that can be paired with 1, then three elements can be paired with the smallest remaining element, and the last two elements can be paired together, giving a total of $5 \times 3 \times 1=15$ ways. Since there are $6!$ permutations of $1,2, \cdots, 6$, the total number of valid tables is
$$
15 \times 6!=10800 \text {. }
$$