Forum Moderators: open

Message Too Old, No Replies

Using Monospaced Fonts

         

peterinwa

7:02 am on Mar 25, 2003 (gmt 0)

10+ Year Member



I am creating a table of data wherein the characters or columns must line up.

1. Is there a common monospaced font that would be on everyone's PC that I could specify?

2. If they didn't have it, would I get a proportionally spaced font which would mess things up?

3. I would like to know how <tt> mode relates to this. Can I specify <tt> mode and select a font? And sizes and colors?

I'm not sure when and why one would use <tt> mode vs. just selecting a mono font.

Thanks for any help you can give, Peter

bcc1234

7:15 am on Mar 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Courier fonts are monospaced.

WibbleWobble

10:05 am on Mar 25, 2003 (gmt 0)

10+ Year Member


Setting the fonts in an order such as "courier, other monospace fonts, monospace, sans-serif" ought to have all users default to their monospace font, and if they don't have any, to a sans-serif one.

peterinwa

3:29 pm on Mar 25, 2003 (gmt 0)

10+ Year Member



Thanks, I'll try that.

If anyone knows I'd still like to understand how using <tt> mode relates to this. And if I should use both techniques.

DrDoc

3:36 pm on Mar 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<tt> uses a monotype font... But, I'd go with the previous suggestion - use a style sheet and assign font values. 99.9% of all the users will have a monospaced font. :)

td {
font-family: "Courier New",Courier,"Andale Mono",monospace;
}

That should do it.

The other solution would be to assign a fixed with to the columns. That way they'd align no matter which font is used...

peterinwa

3:49 pm on Mar 25, 2003 (gmt 0)

10+ Year Member



Thanks, I'll try those fonts.

The column technique is good but I also want the letters within the columns to line up. (I think in all or most fonts numbers are mono, but I want the letters to line up, too.)