[Tex/LaTex] \scalebox not working

tables

I can't figure out why scalebox isn't working. Here's the working example (uncomment the \scalebox line and the file doesn't compile. (I had trouble formatting the long lines).

\documentclass[11pt]{scrartcl}
\usepackage{graphics}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\textwidth}{Xllll}
%\scalebox{.50}
\hline
Type of Violation & 1st & 2nd & 3rd & 4th \\
\hline
\begin{tabular}[c]{@{}l@{}}
Presence without \\
justification, during\\ work hours\\
in an unauthorized\\place\end{tabular} & 10\% & 25\% & 50\% & 1 day \\    
\hline
Receiving non-work    & \begin{tabular}[c]{@{}l@{}}Written\\     Warning\end{tabular} & 10\%   & 15\%    & 25\%      \\
\hline
Personal use      & \begin{tabular}[c]{@{}l@{}}Written\\ 
Warning\end{tabular} & 10\%   & 25\%    & 50\%      \\
\hline
Interference   & 50\%      & 1 day  & 2 days   & 3 days    \\
\hline
Entry/Exit    & \begin{tabular}[c]{@{}l@{}}Written\\ 
Warning\end{tabular} & 10\%   & 15\%    & 25\%      \\

\end{tabularx}



\end{document}  

**This question is about scaling/reducing an entire table in size. The answer at Indentation after '\tabular' environments deals with INDENTING a table. This is NOT my issue.

Best Answer

You can scale a whole table, by using \scalebox{0.5}{<table>}, not with \scalebox{0.5} in the middle of it. However, this wouldn't do anything nice, because the table would be scaled to half the linewidth.

This seems a job for tabulary, with a patch that David will appreciate.

\documentclass[11pt]{scrartcl}
\usepackage{tabulary,array}
\usepackage{xpatch}

\newcommand{\writtenwarning}{%
  \begin{tabular}{@{}l@{}}
  Written \\ Warning
  \end{tabular}%
}

\makeatletter
\xpatchcmd{\TY@box@v}{\vtop}{$\m@th\vcenter}{}{}
\xapptocmd{\TY@box@v}{$}{}{}
\makeatother

\begin{document}

\noindent
\begin{tabulary}{\textwidth}{>{\strut}Lllll}
\hline
Type of Violation & 1st & 2nd & 3rd & 4th \\
\hline
Presence without justification, during work hours
in an unauthorized place & 10\% & 25\% & 50\% & 1 day \\    
\hline
Receiving non-work & \writtenwarning & 10\% & 15\% & 25\% \\
\hline
Personal use & \writtenwarning & 10\%   & 25\%    & 50\% \\
\hline
Interference & 50\% & 1 day  & 2 days   & 3 days \\
\hline
Entry/Exit    & \writtenwarning & 10\%   & 15\%    & 25\% \\
\hline
\end{tabulary}

\end{document}  

enter image description here