http://qs321.pair.com?node_id=1230993


in reply to getting html characters to align

HTML does collapse whitespace, so if you have three spaces they will only display as one space. A common way to deal with that is to replace each space with the HTML entity  . Another way to preserve whitespace is to add white-space: pre; to your .hft-lines CSS definition. The problem with both of these is that each letter is not the same width so the columns will still not line up.

Another way would be to wrap your text in a <pre>..</pre> tag - this will preserve the whitespace and also the column widths, but it does that by using a mono-spaced font (one where each letter is given the same space), but this is usually not that pretty.

I think your best solution would be to use a table, where each letter, and space, is put in a single cell. A bit cumbersome but you will then be able to keep the nice font.

These modules both work with array of array structure:
Text::Table::Tiny
Text::Table::HTML