Possible Duplicate:
prevent “action” if top of page
I have some blocks of text, separated by a \hline. Because the LaTeX code is generated automatically from user-entered data, sometimes the \hline appears last on the page, and sometimes it appears first.
Since the \hline is only used to provide a clear division between blocks, it's not needed last or first on the page, since the page break itself provides the division. Is it possible to hide/ignore/delete the \hline if it would be the first or last element on the page?
Here is some example code to illustrate the issue:
\vspace{20cm} % Adjust as necessary
\parbox[t]{3cm}{Example:}\parbox[t]{15cm}{This is an example}
\hline
\parbox[t]{3cm}{Example:}\parbox[t]{15cm}{This is an example}
\hline
\parbox[t]{3cm}{Example:}\parbox[t]{15cm}{This is an example}
