答案1
我建议其中之一:
\documentclass[11pt,pdftex, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath, diagbox, hhline, booktabs}
\usepackage[table, x11names, svgnames]{xcolor}
\begin{document}
\begin{tabular}{|c|*{3}{>{$}c<{$}|}}
\hline
\diagbox[linewidth=0.2pt, width=\dimexpr \textwidth/10+2\tabcolsep\relax, height=0.6cm]{$\enspace\boldsymbol \alpha $}{$\;\boldsymbol \beta $}
& -1 & 0 & 1 \\
\hline
$ -1 $ & 0& -1 & -2\\
\hline
$ 0 $ & 1 & 0 &-1 \\
\hline
$ 1 $ & 2 & 1 & 0 \\
\hline
\end{tabular}
\bigskip
\begin{tabular}{!{\color{IndianRed3} \vrule}c !{\color{IndianRed3}\vrule\,\vrule}*{2}{>{$}c<{$}!{\color{Lavender}\vrule}} >{$}c<{$}!{\color{IndianRed3}\vrule}}%
\arrayrulecolor{IndianRed3}
\hhline{-||---}
\diagbox[linecolor=Lavender, linewidth=0.3pt, width=\dimexpr \textwidth/10+2\tabcolsep\relax, height=0.6cm]{$ \enspace\boldsymbol \alpha $}{$\;\boldsymbol \beta $}
& -1 & 0 & 1 \\
\hhline{=::===}
$ -1 $ & 0& -1 & -2\\
\hhline{|>{\arrayrulecolor{Lavender}}->{\arrayrulecolor{IndianRed3}}||>{\arrayrulecolor{Lavender}}--->{\arrayrulecolor{IndianRed3}}|}
$ 0 $ & 1 & 0 &-1 \\
\hhline{|>{\arrayrulecolor{Lavender}}-||--->{\arrayrulecolor{IndianRed3}}|}
$ 1 $ & 2 & 1 & 0 \\
\arrayrulecolor{IndianRed3}
\hhline{-||---}
\end{tabular}
\bigskip
$ \setlength\extrarowheight{3pt} \begin{array}{c @{\,}>{\columncolor{Thistle3}[0pt][6pt]}r!{\mkern 2mu}|*{3}{c|}}
\multicolumn{2}{c}{ } & \multicolumn{3}{c}{\boldsymbol \beta }\\
\rowcolor {LightPink2!50}\multicolumn{1}{c}{\cellcolor{white}} &\multicolumn{1}{c!{\mkern4mu}}{\cellcolor{Plum4}} & \multicolumn{1}{c}{-1} & \multicolumn{1}{c}{0} & \multicolumn{1}{c}{1} \\
\addlinespace[0.5ex]
\cline{3-5}
& -1 & 0& -1 & -2\\
\cline{3-5}
\boldsymbol \alpha & 0 & 1 & 0 &-1 \\
\cline{3-5}
& 1 & 2 & 1 & 0 \\
\cline{3-5}
\end{array} $
\end{document}
答案2
您可以尝试这样的方法。
我认为您需要摆脱表格谨慎的外观,并且我不确定对角分割单元格是否可行。
所以我建议你这样做,尽管你可能想考虑使用不同的对齐方式,以便数字彼此对齐,但你在示例中使用了居中,有些人更喜欢这样。但请注意,连字符 (-) 不是减号。你的 -s 需要处于数学模式。
\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{array}
\begin{document}
\begin{tabular}{*{4}{>{\arraybackslash$}c<{$}}}
& \multicolumn{3}{c}{$\beta$} \\
\cmidrule(lr){2-4}
\alpha & -1 & 0 & 1 \\
\midrule
-1 & 0 & -1 & -2 \\
0 & 1 & 0 & -1 \\
1 & 2 & 1 & 0
\end{tabular}
\end{document}