How to export Print Range to HTML

[Modified as requested by a moderator]

I am using LibreOffice Calc, and I am trying to export to HTML. My data is in A1-P40. Calc exports my data, but also includes rows and columns outside of this range. Furthermore, the column widths are all over the place. It seems like, in order to make room for a bunch of empty cells past column P, a few of the columns before P got made narrower. The result is that columns that were the same width in my spreadsheet, are different widths in the generated HTML.

I tried defining a Print Range, but that seems to have had no effect. How do I export just A1-P40, for example? I have not entered anything into cells outside this range.

Previous versions of LO used to do the “right” thing, exporting just the data I entered into HTML that looked remarkably like my spreadsheet. There seems to have been quite serious regression in the export to HTML functionality, based on my casual use, doing exactly the same operation now, compared to several months and years ago, using earlier versions.

I of course googled the problem, and tried defining a Print Range (which I didn’t have to do before), and that seems to have had no impact whatsoever.

I have attached the spreadsheet, and a screencapture of the generated HTML (since I cannot attach an html file).exported.pngschedule.ods

What’s your understanding of empty cells - how do you recognize these empty cells (e.g. if a cell contains a border, it is not empty in the context of exporting to a .html file and you’ll see a bordered cell)?

Try to CTRL+X and/or CTRL+M on cell ranges what you assume empty (but may be in fact isn’t), but exported to html as being part of the html table.

Aside: Similiar problem may occur on exporting to csv files, where you sometimes get lines looking like ;;;;; at the end of the exported file, since the related cells in fact haven’t been empty.

Thanks for the clarification and the attachments; now please see that your spreadsheet does contain something in columns Y to BL: specifically, it containg light-grey borders applied (unlike the rest of empty columns, which don’t have any borders applied). So these cells are not empty from LO point of view. Also the same is true for A72:Q1048576.

Just select column R (clicking on its header); press Ctrl+Shift+; right-click on a header of one of selected columns, and choose Delete Columns. Likewise, select rows 50 and below, and remove them. And then select those unused rows and clear direct formatting (menu Format).

Perfect, thank you! Awesome support!

I can imagine how those borders got defined, but those cells sure looked empty.