I defined a command that contains two different tabulars, when I use book.cls, I want to use this command in odd and even pages.
How can this command test if the page is odd or even to change the two tabular position?
I don't know how to define this command, just like \newcommand{}{}.
=====================================================
As my expression not clear, I have changed the codes. Is there one method, add some check command in \newcommand{}{}, so when use \showtab, let it auto check the current page number is odd or even, so it will change the two tabular positon.
I have just give simple codes to show what I want.
\documentclass[]{article}
\usepackage{colortbl}
\usepackage[table]{xcolor}
\newcommand{\showtab}{\begin{flushleft}
\begin{minipage}[t]{0.4\linewidth}
\begin{tabular}[t]{|p{\linewidth}|}
\hline
text text text text text\\
\hline
\end{tabular}
\end{minipage}\hfill
\begin{minipage}[t]{0.5\linewidth}
\begin{tabular}[t]{@{}p{\linewidth}@{}}
\hline
text text text text text text text text text text text text text text text text\\
\hline
text text text text text text text text\\
\hline
text text text text text text text text\\
\hline
\end{tabular}
\end{minipage}
\end{flushleft}}
\begin{document}
\showtab
\newpage
\showtab
\newpage
\end{document}


\pageref{...}to your command gives odd or even page. for this you need compile your document at least twice. – Zarko Jun 14 '18 at 05:41