Author Topic: How to fix funky html line spacing  (Read 449 times)

Offline roger wood

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 15
  • BeerSmith 3 Rocks!
How to fix funky html line spacing
« on: April 02, 2022, 01:09:03 PM »
When I save a report in html format, the default style does not provide enough space for the contents of a column. Specifically, $MASH_INGREDIENTS gets jammed into a table format where the ingredient name gets 94% of the width, and all other columns (Amt,Type,#,%/IBU,Volume) each are allocated 1% of width. THis forces _all_ of them to wrap their contents and make the output ugly and difficult to read.

Tinkering, I found that column widths of Amt=14%, Name=60%, Type=4%, #=4%,%/IBU=8%,Volume=4% seems to provide enough minimum space to eliminate wrapping.

Where can I change the table class "BeerSmithTable" to fix this, and if I am able to do it, if I go to the cloud can I take it with me or will I be stuck with common, too narrow columns again?

MTIA

Offline GigaFemto

  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 356
  • Muonic Matter Rocks!
Re: How to fix funky html line spacing
« Reply #1 on: April 03, 2022, 03:53:42 PM »
I think you are out of luck. BeerSmithTable is defined in style.css, but that definition does not include column widths. They seem to come from some inaccessible script that fills out the tables like $MASH_INGREDIENTS. Even if you create a custom report you can't access the innards of those tables. The only way I have found to get at them is to export an xml file and import that to Excel or similar.

--GF

Offline roger wood

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 15
  • BeerSmith 3 Rocks!
Re: How to fix funky html line spacing
« Reply #2 on: April 09, 2022, 09:32:33 PM »
That's what I was worried about, GF, and thought was going on. Then I looked at brewsheet.htm that comes with, and saw that in there Brad had specified table column widths etc. as in:
<snip>
    <tr>
    <td width="4%">&nbsp;</td>
    <td width="95%"align="left">$MASH_INGREDIENTS $STEEP_INGREDIENTS</td>
  </tr>
</snip>
I had been trying to build an output from scratch but not put in widths until after seeing the squishing. Interestingly, I also created a minimal "report" as follows that pulls from his style.css and seems to make everything work.
<snip>
    <head>
    <title>$NAME</title>
    <link rel="stylesheet" href="style.css" type="text/css">
    <style type="text/css">
    body { font-size: 10pt; }
    </style>
    </head>
    <body>
    $MASH_INGREDIENTS</p>
    </body>
    </html>
</snip>

Perhaps I was asleep at the wheel the other night?

Offline brewfun

  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 2304
  • Malt dust is just alcohol's glitter
Re: How to fix funky html line spacing
« Reply #3 on: April 10, 2022, 08:44:11 AM »
Then I looked at brewsheet.htm that comes with, and saw that in there Brad had specified table column widths etc. as in:
<snip>
        <td width="4%">&nbsp;</td>
    <td width="95%"align="left">$MASH_INGREDIENTS $STEEP_INGREDIENTS</td>
  </tr>

Those widths are for the boarders around the sections of the report. The 4% is the column width for checking things off. The actual table aligns within the borders and wraps text. The tables are not able to be user formatted, AFAIK.
Beer Appreciation is the space between pints.