Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Superscript (<sup>) and middle alignment in tables

Reply
Thread Tools

Superscript (<sup>) and middle alignment in tables

 
 
jodleren
Guest
Posts: n/a
 
      12-22-2007
Hi

I have this (see code below).
Point: I want the bar to be aligned in the middle of the text, even
when with superscript.
The problem is, that the content in the 2nd <td> is top aligned at all
times.

Superscript is somewhat higher than normal text, but the following ts
does not align as I want it to. Can anyone help me here?

I have a dummy gif 14 pixels high 1 wide. Any gif can be used for
testing.

WBR
Sonnich

<table border="0" cellpspacing="0" cellpadding="0">
<tr><td valign="middle"><b>Day</b>&nbsp;</td><td
valign="middle"><b>Amount</b></td></tr>
<tr><td valign="middle">December 22<sup>nd<sup>&nbsp;</td><td
valign="middle">
<p><img src="graphics/bar.gif" height="14" width="125" alt="">&nbsp;
(125)</p>
</td></tr>
<tr><td valign="middle">December 21<sup>st<sup>&nbsp;</td><td
valign="middle">
<p><img src="graphics/bar.gif" height="14" width="33" alt="">&nbsp;
(33)</p>
</tr></table>
</td></tr>
</table>
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      12-22-2007
In article
<(E-Mail Removed)
m>,
jodleren <(E-Mail Removed)> wrote:

> Hi
>
> I have this (see code below).
> Point: I want the bar to be aligned in the middle of the text, even
> when with superscript.
> The problem is, that the content in the 2nd <td> is top aligned at all
> times.
>
> Superscript is somewhat higher than normal text, but the following ts
> does not align as I want it to. Can anyone help me here?
>
> I have a dummy gif 14 pixels high 1 wide. Any gif can be used for
> testing.
>
> WBR
> Sonnich
>
> <table border="0" cellpspacing="0" cellpadding="0">
> <tr><td valign="middle"><b>Day</b>&nbsp;</td><td
> valign="middle"><b>Amount</b></td></tr>
> <tr><td valign="middle">December 22<sup>nd<sup>&nbsp;</td><td
> valign="middle">
> <p><img src="graphics/bar.gif" height="14" width="125" alt="">&nbsp;
> (125)</p>
> </td></tr>
> <tr><td valign="middle">December 21<sup>st<sup>&nbsp;</td><td
> valign="middle">
> <p><img src="graphics/bar.gif" height="14" width="33" alt="">&nbsp;
> (33)</p>
> </tr></table>
> </td></tr>
> </table>


Recheck your mark up here.

Is this the markup you want to know something about:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>
<table cellspacing="0" cellpadding="0">
<tr>
<td valign="middle"><strong>Day</strong>&nbsp;</td>
<td valign="middle"><strong>Amount</strong></td>
</tr>
<tr>
<td valign="middle">December
22<sup>nd</sup>&nbsp;</td>
<td valign="middle">
<p><img src="crimson.png" height="14" width="125"
alt="">&nbsp; (125)</p>
</td>
</tr>
<tr>
<td valign="middle">December
21<sup>st</sup>&nbsp;</td>
<td valign="middle">
<p><img src="crimson.png" height="14" width="33"
alt="">&nbsp; (33)</p>
</td>
</tr>
</table>
</body>
</html>

?

What?

--
dorayme
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      12-23-2007
Scripsit jodleren:

> I have this (see code below).


Post the URL, if you wish to create a constructive discussion.

> Point: I want the bar to be aligned in the middle of the text, even
> when with superscript.


Which bar? Is the bar open? What's your point?

> The problem is, that the content in the 2nd <td> is top aligned at all
> times.


No it isn't.

> Superscript is somewhat higher than normal text,


Huh? You have done something odd. URL, please.

> but the following ts
> does not align as I want it to. Can anyone help me here?


Try wanting something else. Try posting a URL. Try explaining what you
are really doing.

> I have a dummy gif 14 pixels high 1 wide.


Why?

> Any gif can be used for testing.


Maybe, but we still want the URL.

> <table border="0" cellpspacing="0" cellpadding="0">


Try using valid markup. A validator would help you.

> <tr><td valign="middle"><b>Day</b>&nbsp;</td>


Using <b> is a symptom of poor coding. Is this really a heading cell?

> <tr><td valign="middle">December 22<sup>nd<sup>&nbsp;</td><td


No wonder if you have problems - you have two <sup> start tags and no
end tag for either of them.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
jodleren
Guest
Posts: n/a
 
      12-23-2007
On 23 Dec., 01:54, "Jukka K. Korpela" <(E-Mail Removed)> wrote:
> Scripsit jodleren:
>
> > I have this (see code below).

> Post the URL, if you wish to create a constructive discussion.


Apearently you found the problem anyway below. The code was here and
is simple enough to work as a small file. Even without the picture.

> > Point: I want the bar to be aligned in the middle of the text, even
> > when with superscript.

> Which bar? Is the bar open? What's your point?


Statistics. Save the file and you will see.

> > I have a dummy gif 14 pixels high 1 wide.

> Why?


The bar. I agree that one pixel is enough. Just ended up that way and
it is only 884 bytes, same saize as it would have been for a 1x1 pixel
thing.
But my idea is to make some shades into it later. Not important right
now btw.

> > <table border="0" cellpspacing="0" cellpadding="0">

> Try using valid markup. A validator would help you.


Agree.

> > <tr><td valign="middle"><b>Day</b>&nbsp;</td>

> Using <b> is a symptom of poor coding. Is this really a heading cell?


Yep. And why dont you like it?
Above is suggested <strong>.

> > <tr><td valign="middle">December 22<sup>nd<sup>&nbsp;</td><td

> No wonder if you have problems - you have two <sup> start tags and no
> end tag for either of them.


See? the code here is enough. And it is ok.
And I once again realise, that working to late is not always
good....
Probably I'd have seen it today... when reading it over with a fresg
mind.
 
Reply With Quote
 
jodleren
Guest
Posts: n/a
 
      12-23-2007
On 23 Dec., 00:53, dorayme <(E-Mail Removed)> wrote:
> In article
> <(E-Mail Removed)
> m>,
> *jodleren <(E-Mail Removed)> wrote:


> Recheck your mark up here.
>
> Is this the markup you want to know something about:


I tested it on validator.w3.org and it found 54 errors.
Some of them were my typos above etc and other simple stuff caused by
my tiredness yesterday. And it is ok on.

Still, I get some 26 errors mostly by nested tables... other pages
give none. I cannot see why they are different, as they are all based
on the same system and headers... but sometimes it claims that </td>
not allowed here and <tr height=... is not allowed, sometimes it is
ok. On of the better ones on </head> closing an unopened <head>, as
far as I can read, it is there...
I have a small htm file which I include in as first thing in all
files, so thay are all the same. But the validated result is
different...

Am I the only one seeing this?

WBR & merry christmas
Sonnich
 
Reply With Quote
 
Rob Waaijenberg
Guest
Posts: n/a
 
      12-23-2007
jodleren schreef:

> Am I the only one seeing this?
>
> WBR & merry christmas
> Sonnich


Yes,
because you still haven't given us a URL.

--
Rob
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      12-23-2007
Scripsit jodleren:

> On 23 Dec., 01:54, "Jukka K. Korpela" <(E-Mail Removed)> wrote:
>> Scripsit jodleren:
>>
>>> I have this (see code below).

>> Post the URL, if you wish to create a constructive discussion.

>
> Apearently you found the problem anyway below.


No, I didn't. I just mentioned some of the markup errors (which you
could have found yourself using a validator).

Do you want constructive discussion? If yes, why didn't you post the URL
now, after having been asked to?

>The code was here and
> is simple enough to work as a small file.


No it isn't. If you knew HTML, you would have realized this.

>>> Point: I want the bar to be aligned in the middle of the text, even
>>> when with superscript.

>> Which bar? Is the bar open? What's your point?

>
> Statistics.


Statistics is a subject area, not a point.

> Save the file and you will see.


No I won't. It was part of your homework to save it and post the URL.

>>> I have a dummy gif 14 pixels high 1 wide.

>> Why?

>
> The bar.


You are not helpful in helping others to help you.

>> Using <b> is a symptom of poor coding. Is this really a heading cell?

>
> Yep. And why dont you like it?
> Above is suggested <strong>.


Which part of the sentence "Is this really a heading cell?" did you fail
to understand.

>>> <tr><td valign="middle">December 22<sup>nd<sup>&nbsp;</td><td

>> No wonder if you have problems - you have two <sup> start tags and no
>> end tag for either of them.

>
> See? the code here is enough.


It is enough for seeing that you have either misunderstood HTML or coded
sloppily without using a validator. It is not enough for seeing what you
are trying to accomplish - this would be the first part in finding a
good way to achieve it. Among other things, the &nbsp; looks suspicious.
Why do you use such a coarse and illogical method of creating padding,
instead of using CSS?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      12-23-2007
In article
<(E-Mail Removed)
>,

jodleren <(E-Mail Removed)> wrote:

> On 23 Dec., 00:53, dorayme <(E-Mail Removed)> wrote:
> > In article
> > <(E-Mail Removed)
> > m>,
> > *jodleren <(E-Mail Removed)> wrote:

>
> > Recheck your mark up here.
> >
> > Is this the markup you want to know something about:

>
> I tested it on validator.w3.org and it found 54 errors.
> Some of them were my typos above etc and other simple stuff caused by
> my tiredness yesterday. And it is ok on.
>
> Still, I get some 26 errors mostly by nested tables... other pages
> give none. I cannot see why they are different, as they are all based
> on the same system and headers... but sometimes it claims that </td>
> not allowed here and <tr height=... is not allowed, sometimes it is
> ok. On of the better ones on </head> closing an unopened <head>, as
> far as I can read, it is there...
> I have a small htm file which I include in as first thing in all
> files, so thay are all the same. But the validated result is
> different...
>
> Am I the only one seeing this?
>
> WBR & merry christmas
> Sonnich


And best wishes to you too. I am a bit miffed at your above? I
included for you some html markup that was not error riddled and
was asking you if it was roughly what you had in mind and did you
have some specific question about it. But you are talking about
all sorts of errors as if you had not looked at my effort (which
was not meant to solve any problem but to supply, because it is
xmas, somthing a bit more error free).

But this xmas spirit is getting real strong today and I will go
one further, I will do what you are being urged to do by JK,
namely supply a url:

http://netweaver.com.au/alt/sonnich.html

Now is there some question you have about this (which is sort of
a mildly cleaned up version of yours - "it" does not have 54
errors)?

--
dorayme
 
Reply With Quote
 
jodleren
Guest
Posts: n/a
 
      01-02-2008
On Dec 23 2007, 4:14*pm, Rob Waaijenberg <(E-Mail Removed)>
wrote:
> jodleren schreef:
> > Am I the only one seeing this?

> Yes,
> because you still haven't given us a URL.


Here you are:
http://panbaltica.com/sandpit/test/test.htm
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      01-02-2008
Scripsit jodleren:

> On Dec 23 2007, 4:14 pm, Rob Waaijenberg <(E-Mail Removed)>
> wrote:
>> jodleren schreef:
>>> Am I the only one seeing this?

>> Yes,
>> because you still haven't given us a URL.

>
> Here you are:
> http://panbaltica.com/sandpit/test/test.htm


And the problem was...? I see no superscript there, and I see no <sup>
markup in the source. Is this about something completely different from
the Subject line's topic?

I do see an error message about some scripting error.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
subscript and superscript shahid C++ 14 02-06-2009 11:11 PM
NEC Superscript 870 John in Surrey NZ Computing 0 02-02-2006 02:53 PM
How to change a number to superscript in textarea? dalei HTML 5 08-28-2005 12:47 PM
Superscript in Excel MGT Computer Support 2 07-07-2004 03:19 PM
Display superscript and subscript text in a label =?Utf-8?B?UmFuaSBQb25tYXRoaQ==?= Microsoft Certification 1 04-14-2004 12:39 PM



Advertisments