\label{\detokenize{longtable:longtable-having-caption}}

\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{|l|l|}
\sphinxthelongtablecaptionisattop
\caption{caption for longtable\strut}\label{\detokenize{longtable:id1}}\\*[\sphinxlongtablecapskipadjust]
\hline
\sphinxstyletheadfamily 
header1
&\sphinxstyletheadfamily 
header2
\\
\hline
\endfirsthead

\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}}\\
\hline
\sphinxstyletheadfamily 
header1
&\sphinxstyletheadfamily 
header2
\\
\hline
\endhead

\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}}\\
\endfoot

\endlastfoot

cell1\sphinxhyphen{}1
&
cell1\sphinxhyphen{}2
\\
\hline
cell2\sphinxhyphen{}1
&
cell2\sphinxhyphen{}2
\\
\hline
cell3\sphinxhyphen{}1
&
cell3\sphinxhyphen{}2
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
