[tex4ht] question about missing table vertical lines in HTML after 118 subsections have been processed.

Nasser M. Abbasi nma at 12000.org
Thu Feb 3 22:11:18 CET 2022


On 2/3/2022 8:25 AM, Michal Hoftich wrote:
> Hi Nasser,
> 
>>
>> All subsection use the same latex code to make a small
>> table. The table shows OK with vertical lines showing
>> up to subsection 118, then after that the same table
>> starts showing with the vertical lines missing !
>>
> 
> I think that it is an issue with browsers that are based on Chromium
> or Webkit. They seem to ignore table border instructions at some
> point. It is true that your CSS file is huge, it has hundreds of
> thousands of lines. This huge number is caused by tables.
> 

I think you are right here. I googled this and it says

"Firefox is not based on Chromium (the open source
browser project at the core of Google Chrome). In
fact, we're one of the last major browsers that isn't.
Firefox runs on our Quantum browser engine built specifically for Firefox"

So this explains the difference between what Firefox shows (correct)
and Brave, Edge and Chrome (missing vertical lines after some subsections).

> I dug into the code that handles vertical rules and found that it
> generates some unnecessary instructions, in particular lines like
> #TBL-5586{border-collapse:collapse;}. These can be safely removed, as
> all tabulars have set this property by default. When I removed all of
> these declarations from your CSS file using regex, Chromium could show
> vertical rules.

Yes, I noticed this duplication also when I was looking at the .css,
Actually some had more duplication than others, and I did not know why.

For example this is duplicated 4 times

#TBL-737 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-737{border-collapse:collapse;}
#TBL-737 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-737{border-collapse:collapse;}
#TBL-737 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-737{border-collapse:collapse;}
#TBL-737 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-737{border-collapse:collapse;}

But this one earlier in the .css file, is duplicated 6 times !

#TBL-107 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-107{border-collapse:collapse;}
#TBL-107 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-107{border-collapse:collapse;}
#TBL-107 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-107{border-collapse:collapse;}
#TBL-107 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-107{border-collapse:collapse;}
#TBL-107 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-107{border-collapse:collapse;}
#TBL-107 colgroup{border-left: 1px solid black;border-right:1px solid black;}
#TBL-107{border-collapse:collapse;}

This is why the .css is so large. May be this also affects performance
og loading the pages as I noticed they are slow to come up at first.


> 
> I also found a way how to support individual vertical rules. Right
> now, a table that has one vertical rule, will have set all vertical
> rules, regardless of the original LaTeX code. The new code should fix
> that. Try the following .cfg file:
> 
> %%%%%%%%%%%%%%%%%%%%%
> \Preamble{xhtml}
> 
> \catcode`\:=11
> \Configure{VBorder}
>     {\let\VBorder\empty \let\AllColMargins\empty
>      \global\let\GROUPS\empty \HAssign\NewGroup = 0
>      \gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo }
>     {\xdef\VBorder{\VBorder\ifnum \NewGroup> 0 </colgroup>\fi}
>      \HAssign\NewGroup = 0 % \gdef\GROUPS{rules="groups"}
>    %  \Css{\#TBL-\TableNo\space colgroup{border-left: 1px solid
> black;border-right:1px solid black;}}
>    %\Css{\#TBL-\TableNo{border-collapse:collapse;}}
>    \ifnum\ar:cnt > 0
>      \Css{\#TBL-\TableNo-\ar:cnt {border-right:1px solid black;}}
>    \else
>      \Css{\#TBL-\TableNo-1{border-left: 1px solid black;}}
>    \fi
> }
>     {\Advance:\NewGroup by 1
>      \ifnum \NewGroup=1 \xdef\VBorder{\VBorder<colgroup
>          id="TBL-\TableNo-\ar:cnt g">}\fi
>      \xdef\VBorder{\VBorder<col\Hnewline id="TBL-\TableNo
>         -\ar:cnt"\xml:empty>}\xdef\AllColMargins{\AllColMargins1}}
>     {\xdef\AllColMargins{\AllColMargins 0}}
> \catcode`\:=12
> \begin{document}
> \EndPreamble
> 
> %%%%%%%%%%%%%%%%%%%
> 
> I will update TeX4ht sources, so it should work soon in TL.
> 
> Best regards,
> Michal
> 

Thank you for the fix. I will test the above later tonight, The HTML build
takes about 10 hrs to finish (pdf about 1 hr) so I will see the result
sometime tomorrow.

--Nasser


More information about the tex4ht mailing list.