When I compile this MWE in lualatex
\documentclass[11pt]{article}%
\usepackage{longtable}
\begin{document}
This is my long table
\begin{longtable}{|c|c|}
\caption{my caption}\\\hline
A & B \\\hline
853.075 (sec) & 43.711 (sec)\\\hline
14.218 (minutes) & 0.729 (minutes)\\\hline
\end{longtable}
my long table is done
\end{document}
The output comes as expected
But using make4ht foo.tex -c my.cfg "htm"
with my.cfg
as
\Preamble{xhtml}
\Css{div.caption{text-align:center;}}
\begin{document}
\EndPreamble
The HTML output looks like this
Notice the edge lines are too long.
If I remove the caption, then it is OK:
\documentclass[11pt]{article}%
\usepackage{longtable}
\begin{document}
This is my long table
\begin{longtable}{|c|c|}\hline
A & B \\\hline
853.075 (sec) & 43.711 (sec)\\\hline
14.218 (minutes) & 0.729 (minutes)\\\hline
\end{longtable}
my long table is done
\end{document}
And now compile using make4ht foo.tex "htm"
then the output is OK, same as PDF
If I use this .cfg file instead of the above
\Preamble{xhtml}
\Css{div.caption{text-align:center;}}
\Configure{float}{\csname par\endcsname\ShowPar}
{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="float">}}
{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}\ShowPar}
\begin{document}
\EndPreamble
On the first MWE shown above, then the output looks like this, where now the caption is inside the table itself
Which is not too bad, I can live with this. It looks better than the first example with the extra edges there.
Is there an easy workaround to the caption above the table without the extra lines? as in the PDF output?
Using TL 2018 on linux
references: how-to-make-caption-be-centered-under-table-when-using-tex4ht
and