bugtex4ht - Bugs: bug #440, tabular generates invalid html due...

Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #440: tabular generates invalid html due to trailing row

Submitted by:  Alex Watson <rotprsl2>
Submitted on:  Wed Oct 16 14:31:09 2019  
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Mon Dec 16 23:57:11 2019, comment #7:

fixed in make4ht, i think, so closing.

Karl Berry <karl>
Project Administrator
Tue Oct 22 21:10:13 2019, comment #6:


I've added this code as a new domfilter to make4ht. It is also used in the `common_domfilters` extension. So with the soon to be released make4ht version, you will just need to use

make4ht -f html5+common_domfilters filename.tex

This extension also fixes other issues, so it is usually a good idea to use it.

Michal Hoftich <michal_h21>
Project Member
Sun Oct 20 20:23:25 2019, comment #5:

Great - this looks good even with booktabs tables.

Alex Watson <rotprsl2>
Thu Oct 17 12:11:11 2019, comment #4:

It seems that booktabs commands only add CSS declarations for the rows with borders. I've updated the build file to check also the CSS, so it should be OK. Here is a new version.

I will definitely made filter from this code, I will also include it to `common_domfilters` extension.

(file #326)

Michal Hoftich <michal_h21>
Project Member
Thu Oct 17 07:49:31 2019, comment #3:

Unfortunately, on further testing, I think this may introduce a regression in booktabs tables with \cmidrule. It might also be a bug in the \cmidrule code, though. I will prepare a test case later.

Alex Watson <rotprsl2>
Thu Oct 17 07:45:03 2019, comment #2:

Thank you Michal, this fixes the trailing row problem for me. Is this expected to be added to tex4ht (or make4ht) in a future release?


Alex Watson <rotprsl2>
Wed Oct 16 21:20:58 2019, comment #1:

You can try the attached build file. It tries to remove all empty rows from tables. It is not easily possible to detect empty rows at the moment when tex4ht inserts starting tags for rows, I think. So the Lua post-processing seems like a best solution. Execute it using

make4ht -e build.lua filename.tex

(file #325)

Michal Hoftich <michal_h21>
Project Member
Wed Oct 16 14:31:09 2019, original submission:

The attached file ht-tabular.tex produces (with make4ht and format html5) an HTML file with a spurious trailing row at the end of the table. The W3C validator complains "A table row was 1 columns wide, which is less than the column count established using column markup".

In this example you might say that one should remove the last "\\" from the tabular environment, but when using "booktabs" package with "\toprule" and "\bottomrule", the last cr is required to draw the rule.

Alex Watson <rotprsl2>


Attached Files
file #326:  build.lua added by michal_h21 (2kB - text/x-lua)
file #325:  build.lua added by michal_h21 (1kB - text/x-lua)
file #322:  ht-tabular.tex added by rotprsl2 (115B - text/x-tex)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by michal_h21 (Updated the item)
  • -unavailable- added by rotprsl2 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    4 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Dec 16 23:57:11 2019karlOpen/ClosedOpen=>Closed
    Thu Oct 17 12:11:11 2019michal_h21Attached File-=>Added build.lua, #326
    Wed Oct 16 21:20:58 2019michal_h21Attached File-=>Added build.lua, #325
    Wed Oct 16 14:31:09 2019rotprsl2Attached File-=>Added ht-tabular.tex, #322
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup+gray