473,786 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alignment to char and other things

[My first post from Google Groups. Hope it's readable.]

I'm working with some semi-advanced tables with lots of decimal
numbers in, and I can't get the alignment to work.

http://www.algonet.se/~gustafl/temp/output_ib.html

I want numbers aligned to the decimal point. The HTML 4 spec says User
agents doesn't need to support 'char' and 'charoff', so I wonder if
the problem is lack of support? If so, can the same results be
achieved in another way?

Next best would be aligning the number to right, but there seem to be
a problem with support for <colgroup> aswell. Am I right? Best
solution I found was to have a class for right alignment and call it
from each <td>.

Also, can someone give me a way to prevent negative numbers to break
after the minus? A solution that adds the least clutter to the code?
Would it be right typographically to replace the minus with an
'endash' (#x2013;)?

Thanks,

Gustaf
Jul 20 '05 #1
30 3525
Gustaf Liljegren wrote:
[My first post from Google Groups. Hope it's readable.]
Looks fine.
I'm working with some semi-advanced tables with lots of decimal
numbers in, and I can't get the alignment to work.

http://www.algonet.se/~gustafl/temp/output_ib.html

I want numbers aligned to the decimal point. The HTML 4 spec says User
agents doesn't need to support 'char' and 'charoff', so I wonder if
the problem is lack of support? If so, can the same results be
achieved in another way?


Use (or at least suggest) a monospaced font for the numbers. There's
little benefit to be achieved from decimal point-aligning numbers unless
each fo the place values line up.

--
Mark.
Jul 20 '05 #2
On 24 May 2004, Gustaf Liljegren wrote:
Also, can someone give me a way to prevent negative numbers to break
after the minus?
Have a look at
<http://www.cs.tut.fi/~jkorpela/html/nobr.html>
<http://www.cs.tut.fi/~jkorpela/dashes.html>
Would it be right typographically to replace the minus with an
'endash' (#x2013;)?


No.
- is a hyphen
− is a minus sign
– is an en-dash

Prefer decimal character references to hexadecimal references.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 20 '05 #3
"Gustaf Liljegren" <gu*****@algone t.se> wrote in
comp.infosystem s.www.authoring.html:
I want numbers aligned to the decimal point. The HTML 4 spec says User
agents doesn't need to support 'char' and 'charoff', so I wonder if
the problem is lack of support?


I'm afraid that is exactly the problem.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #4
Gustaf Liljegren wrote:
[My first post from Google Groups. Hope it's readable.]
It looks fine; be careful when replying, as Google Groups replies tend
to use stange "quote" markers.
I want numbers aligned to the decimal point. can the same results be achieved in another way?
Use a fixed width font, and make sure the data has the same number of
decimal places, e.g., 2.087, 3.340, 4.000, etc.
Next best would be aligning the number to right,
Right, add right align presentation, and see how that works for you.
but there seem to be a problem with support for <colgroup> aswell. Am
I right?
No. text-align does not apply to <col> or <colgroup>.

http://www.w3.org/TR/CSS21/tables.html#q4

http://ln.hixie.ch/?start=1070385285&count=1
Best solution I found was to have a class for right alignment and
call it from each <td>.


I'm afraid that's the best solution for aligning only 1 column of a table.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #5
On Mon, 24 May 2004 10:52:20 -0400, Brian
<us*****@juliet remblay.com.inv alid> wrote:
I want numbers aligned to the decimal point.

can the same results be achieved in another way?


Use a fixed width font, and make sure the data has the same number of
decimal places, e.g., 2.087, 3.340, 4.000, etc.


You can also use %nbsp; to replace leading 0's, as in 10.42, 58.30,
&nbsp;9.85 ...
Jul 20 '05 #6

"Andreas Prilop" <nh******@rrz n-user.uni-hannover.de> wrote in message
news:Pine.GSO.4 .44.04052415254 00.12520-100000@s5b003.. .
On 24 May 2004, Gustaf Liljegren wrote:
Also, can someone give me a way to prevent negative numbers to break
after the minus?


Have a look at
<http://www.cs.tut.fi/~jkorpela/html/nobr.html>
<http://www.cs.tut.fi/~jkorpela/dashes.html>
Would it be right typographically to replace the minus with an
'endash' (#x2013;)?


No.
- is a hyphen
− is a minus sign
– is an en-dash

Prefer decimal character references to hexadecimal references.


Why is that, actually? It's certainly easier just to use the codes the way
they appear in the Unicode reference, and I don't know any benefit to using
decimal values. Also, assuming any can be cited, why would they be
applicable to Unicode references and not to color references?

Jul 20 '05 #7

"Neal" <ne*****@yahoo. com> wrote in message
news:op******** ******@news.ind ividual.net...
On Mon, 24 May 2004 10:52:20 -0400, Brian
<us*****@juliet remblay.com.inv alid> wrote:
I want numbers aligned to the decimal point.

can the same results be achieved in another way?


Use a fixed width font, and make sure the data has the same number of
decimal places, e.g., 2.087, 3.340, 4.000, etc.


You can also use %nbsp; to replace leading 0's, as in 10.42, 58.30,
&nbsp;9.85 ...


You'll find that &nbsp; doesn't have the width of a digit. It seems to be
just over half of the width of a digit on IE6, Firefox, and Opera.

Unicode has &#x2007; ( ), "figure space", to serve this purpose. In my
IE6, though, this gives a box; in my Firefox it produces a space that's
slightly too wide; and in my Opera it seems to work just fine.

Jul 20 '05 #8
On Mon, 24 May 2004, Harlan Messinger wrote:
Prefer decimal character references to hexadecimal references.
Why is that, actually?


Decimal references are better supported among browsers:
<http://ppewww.ph.gla.a c.uk/~flavell/charset/checklist.html>
<http://ppewww.ph.gla.a c.uk/~flavell/charset/quick#cons>
e.g. Netscape 4.x.
It's certainly easier just to use the codes the way
they appear in the Unicode reference,
Easy reading is hard writing.
_You_ as the author, as a single person convert only once. But your
million readers read a million times (hopefully).
and I don't know any benefit to using decimal values.


See above.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 20 '05 #9
On Mon, 24 May 2004, Harlan Messinger wrote:
Use a fixed width font, [ ... ]


You can also use %nbsp; to replace leading 0's, [ ... ]


You'll find that &nbsp; doesn't have the width of a digit.


It does - in a monospaced font.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
7791
by: Bhalchandra Thatte | last post by:
I am allocating a block of memory using malloc. I want to use it to store a "header" structure followed by structs in my application. How to calculate the alignment without making any assumption about the most restrictive type on my machine? Thanks.
10
3242
by: j0mbolar | last post by:
for any pointer to T, does a pointer to T have different or can have different alignment requirement than a pointer to pointer to T? if so, where is the exact wording in the standard that would suggest so?
67
10759
by: S.Tobias | last post by:
I would like to check if I understand the following excerpt correctly: 6.2.5#26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Does it mean that *all* structure (or union) types have the same alignment? Eg. type
13
2999
by: aegis | last post by:
The following was mentioned by Eric Sosman from http://groups.google.com/group/comp.lang.c/msg/b696b28f59b9dac4?dmode=source "The alignment requirement for any type T must be a divisor of sizeof(T). (Proof: In `T array;' both `array' and `array' must be correctly aligned.) Since `sizeof(unsigned char)' is divisible only by one and since one is a divisor of every type's size, every type is suitably aligned for `unsigned char'."
3
2504
by: Bill Pursell | last post by:
I have a program that does most of its work traversing a bunch of lists. The lists contain a void *, and I spent some time today replacing the void *'s with a copy of the data at the end of the structure as a zero length array. The performance improvement that resulted by avoiding the need to dereference the ptr was substantial, but it has left me with an uncertain feeling. In particular, changing an assignment caused the output to...
12
818
by: Yevgen Muntyan | last post by:
Hey, Consider the following code: #include <stdlib.h> #define MAGIC_NUMBER 64 void *my_malloc (size_t n) { char *result = malloc (n + MAGIC_NUMBER);
10
2214
by: haomiao | last post by:
I want to implement a common list that can cantain any type of data, so I declare the list as (briefly) --------------------------------------- struct list { int data_size; int node_num; char nodes; //will be list_node1,list_node2... };
11
2306
by: Brian Gladman | last post by:
A lot of low level cryptographic code and some hardware cryptographic accelerators either fail completely or perform very poorly if their input, output and/or key storage areas in memory are not aligned on specific memory boundaries. Moreover, in many situations the cryptographic code does not itself have control over the memory alignment of its parameters so the best it can do is to detect if these aligmments are correct and act...
1
4339
by: RazvanD | last post by:
Hi! I am trying to get the page-aligned address for an ordinary memory address. As I am using an x86-based CPU the page size is 4KB. Thus, assuming addr is the memory address, I could get the page-aligned address by using the following methods:
8
2831
by: Stephen Horne | last post by:
I understand that the next C++ standard will have features to handle the alignment of data types. This is good, but a bit late for me! I've been using some template trickery to handle alignment issues for some time. What I usually want is a type that takes the same amount of space and has the same alignment as some other type, but which doesn't have constructors, destructors etc. The idea is that initialisation and cleanup can be done...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.