2. In a $3 \times 3$ grid, the numbers $1,2,3,4,5,6,7,8,9$ are filled in, with one number per cell. Now, the cells containing the maximum number in each row are colored red, and the cells containing the minimum number in each row are colored green. Let $M$ be the smallest number in the red cells, and $m$ be the largest number in the green cells. Then $M-m$ can take on different values.
2.8

Obviously, $3 \leqslant m, M \leqslant 7$, and $m \neq M$. Therefore,
$$
M-m \in\{-4,-3,-2,-1,1,2,3,4\} \text {. }
$$

As shown in Figure 7, all 8 values can be obtained
\begin{tabular}{|l|l|l|}
\hline 7 & 9 & 8 \\
\hline 6 & 5 & 4 \\
\hline 3 & 2 & 1 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|}
\hline 6 & 9 & 8 \\
\hline 7 & 5 & 4 \\
\hline 3 & 2 & 1 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|}
\hline 5 & 9 & 8 \\
\hline 7 & 6 & 4 \\
\hline 3 & 2 & 1 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|}
\hline 5 & 9 & 8 \\
\hline 7 & 6 & 1 \\
\hline 4 & 3 & 2 \\
\hline
\end{tabular}
$M=3, m=7$
$M=3, m=6$
$M=3, m=5$
$M=4, m=5$
\begin{tabular}{|l|l|l|} \hline 9 & 8 & 5 \\ \hline 7 & 4 & 2 \\ \hline 6 & 3 & 1 \\ \hline \end{tabular}
\begin{tabular}{|l|l|l|} \hline 9 & 6 & 5 \\ \hline 8 & 4 & 2 \\ \hline 7 & 3 & 1 \\ \hline \end{tabular}
\begin{tabular}{|l|l|l|}
\hline 9 & 6 & 4 \\
\hline 8 & 5 & 2 \\
\hline 7 & 3 & 1 \\
\hline
\end{tabular}
\begin{tabular}{|l|l|l|}
\hline 9 & 6 & 3 \\
\hline 8 & 4 & 2 \\
\hline 7 & 5 & 1 \\
\hline
\end{tabular}
$M=6, m=5$
$M=7, m=5$
$M=7, m=4$
$M=7, m=3$
Figure 7