[Tex/LaTex] How to make this table prettier

tables

Self-explanatory title. I'm new to LaTeX and this table looks pretty ugly.

enter image description here

\documentclass[letterpaper]{article}
\special{papersize=8.5in,11in}
\usepackage{indentfirst}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsmath}

\usepackage{gensymb}
\usepackage[margin=1in]{geometry}
\setlength{\parskip}{1em}

\begin{document}

\begin{table}
\centering
\begin{tabular}{|c|ccccc|} 
\hline
     &  $0$ & $\frac{\pi}{6}$      & $\frac{\pi}{4}$      & $\frac{\pi}{6}$      
& $\frac{\pi}{2}$  \\ 
\hline
$\sin x$ & $0$  & $\frac{1}{2}$        & $\frac{\sqrt{2}}{2}$ & 
$\frac{\sqrt{3}}{2}$ & $1$  \\
$\cos x$ & $1$  & $\frac{\sqrt{3}}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{1}{2}$        & $0$  \\
$\tan x$ & $0$  & $\frac{\sqrt{3}}{3}$ & $1$                  & $\sqrt{3}$           &   \\
\hline
\end{tabular}
\end{table}

\end{document}

Thank you.

Best Answer

I'd keep it as simple as possible.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}

\usepackage{booktabs}
\usepackage{array}
\usepackage{caption} % optional

\begin{document}

\begin{table}

\centering

\caption{Table of trigonometric functions for common angles}

$
\setlength{\arraycolsep}{12pt} % for this particular table
\begin{array}{@{} l *{5}{>{\displaystyle}c} @{}}
\toprule
  &  0 & \frac{\pi}{6}      & \frac{\pi}{4}      & \frac{\pi}{6} & \frac{\pi}{2}  \\ 
\midrule
\sin x
  & 0  & \frac{1}{2}        & \frac{\sqrt{2}}{2} & \frac{\sqrt{3}}{2} & 1  \\
\addlinespace
\cos x
  & 1  & \frac{\sqrt{3}}{2} & \frac{\sqrt{2}}{2} & \frac{1}{2}        & 0  \\
\addlinespace
\tan x
  & 0  & \frac{\sqrt{3}}{3} & 1                  & \sqrt{3}           &   \\
\bottomrule
\end{array}
$

\end{table}

\end{document}

I use array to simplify the input (no $ necessary except around the array). With \addlinespace we can easily separate the lines. With a larger value of \arraycolsep we better separate the columns for ease of reading in this particular case.

enter image description here

Related Question