Equivalent to graphicx draft/demo option for tables
I've borrowed some work from Draft mode for pgfplots in the solution below.
If you use
\documentclass[draft]{article}
then all the tables
will not appear. If you use
\documentclass{article}
then they'll appear as usual.
I've used the verbatim
package just for the comment
environment.
Measuring the dimensions of the table would be tricky- perhaps this will help someone go in that direction.
%\documentclass{article}
\documentclass[draft]{article}
\usepackage{verbatim}
\makeatletter
\@tempswafalse
\def\@tempa{draft}
\@for\next:=\@classoptionslist\do
{\ifx\next\@tempa\@tempswatrue\fi}
\if@tempswa % draft option is active
\renewenvironment{table}{\comment}{\endcomment}
\fi
\makeatother
\begin{document}
hello world
\begin{table}[!htb]
\begin{minipage}{.5\textwidth}
\centering
\caption{}
\label{tab:first}
\begin{tabular}{rcl}
right & center & left \\
right & center & left
\end{tabular}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\caption{}
\label{tab:second}
\begin{tabular}{rcl}
right & center & left \\
right & center & left
\end{tabular}
\end{minipage}
\end{table}
\end{document}
Alternative
Or else you might prefer to load tikz
or pgf
and then use the following in the \ifdraft
check
\renewenvironment{tabular}{%
\pgfpicture\pgfpathrectanglecorners{\pgfpointorigin}{\pgfpoint{3cm}{3cm}}%
\pgfusepath{stroke}\endpgfpicture%
\comment}{\endcomment}
which gives