! 放错位置 \noalign

! 放错位置 \noalign

我无法解决这个错误:

! Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.12    \hline

我的代码是这样的:

\documentclass{article}

\usepackage{slashbox}
\usepackage{siunitx}

\begin{document}

\begin{table}
 \begin{center}
  \begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
   $
   \hline
   \backslashbox{\theta_1}{\theta_2} & \ang{0}             & \ang{30}                     & \ang{45}                     & \ang{60}                     & \ang{90}            & \ang{120}                    & \ang{135}                    & \ang{150}                    & \ang{180}           & \ang{210}                    & \ang{225}                    & \ang{240}                    & \ang{270}           & \ang{300}                    & \ang{315}                    & \ang{330}                    & \ang{360}           \\
   \hline \hline
   \ang{0}                           & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & \frac{1}{2}                  & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  \\
   \hline
   \ang{30}                          & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{\sqrt{3}}{2}          & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} \\
   \hline
   \ang{45}                          & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} \\
   \hline
   \ang{60}                          & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        \\
   \hline
   \ang{90}                          & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   \\
   \hline
   \ang{120}                         & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{\sqrt{3}}{2}          & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         \\
   \hline
   \ang{135}                         & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}{4}  & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  \\
   \hline
   \ang{150}                         & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2] & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  \\
   \hline
   \ang{180}                         & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   \\
   \hline
   \ang{210}                         & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & \frac{\sqrt{3}}{2}           & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  \\
   \hline
   \ang{225}                         & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  \\
   \hline
   \ang{240}                         & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}-\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         \\
   \hline
   \ang{270}                         & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   \\
   \hline
   \ang{300}                         & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}        \\
   \hline
   \ang{315}                         & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} \\
   \hline
   \ang{330}                         & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} \\
   \hline
   \ang{360}                         & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  \\
   \hline
   $
  \end{tabular}
 \end{center}
\end{table}

\end{document}

我是 TeX 初学者,因此非常感激任何帮助。

答案1

为了在数学模式下设置表格的条目,您需要array。但是,slashboxdiagbox(较新且维护良好)显然都不能用于array

一个解决方法是告诉 LaTeX 设置每一个数学模式中的列。但您不能只陈述$after\begin{tabular}{...}和 before \end{tabular}

\documentclass{article}
\usepackage[a4paper,landscape,margin=1cm]{geometry}

\usepackage{diagbox,array}
\usepackage{siunitx}

\begin{document}

\begin{table}
\centering
\addtolength{\tabcolsep}{-3pt}
  \begin{tabular}{|c|| *{17}{>{$}c<{$}|}}
   \hline
   \diagbox{$\theta_1$}{$\theta_2$}
 & \ang{0}             & \ang{30}                     & \ang{45}                     & \ang{60}                     & \ang{90}            & \ang{120}                    & \ang{135}                    & \ang{150}                    & \ang{180}           & \ang{210}                    & \ang{225}                    & \ang{240}                    & \ang{270}           & \ang{300}                    & \ang{315}                    & \ang{330}                    & \ang{360}           \\
   \hline \hline
   \ang{0}                           & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & \frac{1}{2}                  & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  \\
   \hline
   \ang{30}                          & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{\sqrt{3}}{2}          & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} \\
   \hline
   \ang{45}                          & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} \\
   \hline
   \ang{60}                          & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        \\
   \hline
   \ang{90}                          & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   \\
   \hline
   \ang{120}                         & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{\sqrt{3}}{2}          & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         \\
   \hline
   \ang{135}                         & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  \\
   \hline
   \ang{150}                         & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  \\
   \hline
   \ang{180}                         & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   \\
   \hline
   \ang{210}                         & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & \frac{\sqrt{3}}{2}           & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  \\
   \hline
   \ang{225}                         & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  \\
   \hline
   \ang{240}                         & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}-\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         \\
   \hline
   \ang{270}                         & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   \\
   \hline
   \ang{300}                         & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}        \\
   \hline
   \ang{315}                         & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} \\
   \hline
   \ang{330}                         & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} \\
   \hline
   \ang{360}                         & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  \\
   \hline
  \end{tabular}
\end{table}

\end{document}

我不确定这样的桌子有什么用处。

在此处输入图片描述

方形细胞:真是太可怕了!:-)

\documentclass{article}
\usepackage[a0paper]{geometry}
\usepackage{amsmath}
\usepackage{diagbox,array}
\usepackage{siunitx}

\newlength{\bigtablewd}

\begin{document}

\begin{table}
\centering
\settowidth{\bigtablewd}{$-\dfrac{\sqrt{6}+\sqrt{2}}{4}$}
\newcommand{\tablestrut}{%
  \vphantom{$\left|\rule{0pt}{\dimexpr0.5\bigtablewd+\tabcolsep}\right.$}%
}
  \begin{tabular}{|c|| *{17}{>{\tablestrut$\displaystyle}w{c}{\bigtablewd}<{$}|}}
   \hline
   \diagbox{$\theta_1$}{$\theta_2$}
 & \ang{0}             & \ang{30}                     & \ang{45}                     & \ang{60}                     & \ang{90}            & \ang{120}                    & \ang{135}                    & \ang{150}                    & \ang{180}           & \ang{210}                    & \ang{225}                    & \ang{240}                    & \ang{270}           & \ang{300}                    & \ang{315}                    & \ang{330}                    & \ang{360}           \\
   \hline \hline
   \ang{0}                           & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & \frac{1}{2}                  & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  \\
   \hline
   \ang{30}                          & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{\sqrt{3}}{2}          & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} \\
   \hline
   \ang{45}                          & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} \\
   \hline
   \ang{60}                          & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        \\
   \hline
   \ang{90}                          & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   \\
   \hline
   \ang{120}                         & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{\sqrt{3}}{2}          & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         \\
   \hline
   \ang{135}                         & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  \\
   \hline
   \ang{150}                         & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  \\
   \hline
   \ang{180}                         & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   \\
   \hline
   \ang{210}                         & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & \frac{\sqrt{3}}{2}           & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  \\
   \hline
   \ang{225}                         & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  \\
   \hline
   \ang{240}                         & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}-\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         \\
   \hline
   \ang{270}                         & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   \\
   \hline
   \ang{300}                         & -\frac{1}{2}        & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{2}                  & \frac{\sqrt{3}}{2}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{\sqrt{3}}{2}           & \frac{1}{2}         & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{2}                 & -\frac{\sqrt{3}}{2} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}        \\
   \hline
   \ang{315}                         & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{\sqrt{6}-\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{6}+\sqrt{2}}{4}  & \frac{1}{\sqrt{2}}  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{\sqrt{6}-\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{6}+\sqrt{2}}{4} & -\frac{1}{\sqrt{2}} \\
   \hline
   \ang{330}                         & -\frac{\sqrt{3}}{2} & -\frac{1}{2}                 & -\frac{\sqrt{6}-\sqrt{2}}{4} & 0                            & \frac{1}{2}         & \frac{\sqrt{3}}{2}           & \frac{\sqrt{6}+\sqrt{2}}{4}  & 1                            & \frac{\sqrt{3}}{2}  & \frac{1}{2}                  & \frac{\sqrt{6}-\sqrt{2}}{4}  & 0                            & -\frac{1}{2}        & -\frac{\sqrt{3}}{2}          & -\frac{\sqrt{6}+\sqrt{2}}{4} & -1                           & -\frac{\sqrt{3}}{2} \\
   \hline
   \ang{360}                         & -1                  & -\frac{\sqrt{3}}{2}          & -\frac{1}{\sqrt{2}}          & -\frac{1}{2}                 & 0                   & \frac{1}{2}                  & \frac{1}{\sqrt{2}}           & \frac{\sqrt{3}}{2}           & 1                   & \frac{\sqrt{3}}{2}           & \frac{1}{\sqrt{2}}           & \frac{1}{2}                  & 0                   & -\frac{1}{2}                 & -\frac{1}{\sqrt{2}}          & -\frac{\sqrt{3}}{2}          & -1                  \\
   \hline
  \end{tabular}
\end{table}

\end{document}

在此处输入图片描述

相关内容