Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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


In reply to Re: getting html characters to align by tangent
in thread getting html characters to align by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found