DeepBlueCLtd / LegacyMan

Legacy content for Field Service Manual
https://deepbluecltd.github.io/LegacyMan/index.html
Apache License 2.0
2 stars 0 forks source link

Use colspans in generating number of columns #512

Closed IanMayo closed 12 months ago

IanMayo commented 12 months ago

One file contains an 8-column table.

We're mocking it in wales_composite.html. We mock it by inserting a row of 8 cells.

But, there are not any rows with 8 cells in the data. There are rows with 2, 4 or 6 cells. The 6 cell rows have two "colspan=2" cells - to force the layout engine to accept 8 columns.

I have mocked this pattern in this PR #513

robintw commented 12 months ago

Is this only present in one file? Can we edit the source, or put some kind of tag/note in the file to tell us to treat it as an 8 column table? The table conversion code quite reasonably assumes that the maximum number of columns in any row of the table is the number of columns that table has. The source HTML table makes no sense to have an 8 column table without 8 columns anywhere within it. I think that extending our table code to try and handle columns like this will make it a lot more fragile, and more likely to break on other tables that it currently processes correctly.

What do you think? Can we edit the file so that it only has the number of columns it actually uses?

robintw commented 12 months ago

Actually, I have one idea that might make it work without being too fragile. It'll rely on assuming that there is a cell that is colspanned across the entire width of the table. I'll have a little go at it when I've got time.

robintw commented 12 months ago

Yes, this idea works. I'll tidy it up and do a PR.

robintw commented 12 months ago

Fixed in #511