It seems to be a problem still not solved (related to question 311689 and 73508). The usage of colortbl package with tex4ht causes the error: Misplaced \noalign.

Here is a short example to reproduce the error:

test & 1 \\
test & 2 \\

In the .log file I got:

! Misplaced \noalign.
\a:hline ->\ifx \ar:cnt \:UnDef \else \o:noalign: 
                                                  {\append:def \hline:s {\a:...
l.7 \hline

I've also tried to define a .cfg file to make the command \arrayrulecolor do nothing:


Unfortunately it also did not work.

1 Answer 1


Try this .cfg file:

% default hline color is black
% redefine default table configuration and put the color rule 
\def\a:HBorder{<tr class="hline" style="border-top:1px solid \#\hline:color">}
% get the rule color and convert it to a CSS definition stored in \hline:color
% use \HLet to support picture tables
% don't display <hr> elements in this \hline
\Css{tr.hline td hr{display:none}}

The issue you had with your redefinition is that it needs to use the \noalign command. In this config file, we use it to covert the color definition to CSS format and save it in \hline:color macro. It can be then used to insert the color definition in the HTML file.

We don't redefine \arrayrulecolor directly, but using temporary macro and \HLet command. This method will keep the original macro and call it inside \Picture command. This is necessary for the pic-tabular option, which turns tables into pictures.

The \a:HBorder macro inserts code for hline rows. We use the saved color to insert CSS code that colors border.

Your gray \hline then looks like this:

<tr class='hline' style='border-top:1px solid #B2B2B2'>

And it is rendered in this way:

enter image description here

You must log in to answer this question.

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