The package colortbl steals my beloved horizontal rules in the longtable. When I run tex4ht.

% run: htlatex main.tex



fooo & baaar \\\hline
baz &  morebaz\\\hline


The file above gives a beautiful html, but when I load the package colortbl, it eats my \hline.

Question: how to get the horizontal rules and use the package colortbl?

1 Answer 1


Not sure of the official tex4ht customisation but the hrules end up as empty table rows with distinctive ids so you can add css rules such as

 #TBL-1-2-{ border-style: solid; border-bottom: 1pt; border-color: black;}
 #TBL-1-19-{ border-style: solid; border-bottom: 1pt; border-color: black;}

and the lines come back.

  • The id is not stable. If I add lines to the table, the ids will move....
    – topskip
    Sep 21, 2012 at 17:43
  • yes I know, They are I think the table and row number, but its best I could do in the time available tonight. If someone posts a proper tex4ht customisation I'll delete this. Sep 21, 2012 at 19:26
  • colortbl.4ht needs thorough rework. I am working on it, but not sure, when I'll be able to post a solution. As a workaround what you had suggested seems good enough than having nothing. Sep 22, 2012 at 4:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .