Superscript (<sup>) and middle alignment in tables

Discussion in 'HTML' started by jodleren, Dec 22, 2007.

  1. jodleren

    jodleren Guest

    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>
     
    jodleren, Dec 22, 2007
    #1
    1. Advertising

  2. jodleren

    dorayme Guest

    In article
    <
    m>,
    jodleren <> 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
     
    dorayme, Dec 22, 2007
    #2
    1. Advertising

  3. 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/
     
    Jukka K. Korpela, Dec 23, 2007
    #3
  4. jodleren

    jodleren Guest

    On 23 Dec., 01:54, "Jukka K. Korpela" <> 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.
     
    jodleren, Dec 23, 2007
    #4
  5. jodleren

    jodleren Guest

    On 23 Dec., 00:53, dorayme <> wrote:
    > In article
    > <
    > m>,
    >  jodleren <> 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
     
    jodleren, Dec 23, 2007
    #5
  6. jodleren schreef:

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


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

    --
    Rob
     
    Rob Waaijenberg, Dec 23, 2007
    #6
  7. Scripsit jodleren:

    > On 23 Dec., 01:54, "Jukka K. Korpela" <> 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/
     
    Jukka K. Korpela, Dec 23, 2007
    #7
  8. jodleren

    dorayme Guest

    In article
    <
    >,

    jodleren <> wrote:

    > On 23 Dec., 00:53, dorayme <> wrote:
    > > In article
    > > <
    > > m>,
    > >  jodleren <> 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
     
    dorayme, Dec 23, 2007
    #8
  9. jodleren

    jodleren Guest

    On Dec 23 2007, 4:14 pm, Rob Waaijenberg <>
    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
     
    jodleren, Jan 2, 2008
    #9
  10. Scripsit jodleren:

    > On Dec 23 2007, 4:14 pm, Rob Waaijenberg <>
    > 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/
     
    Jukka K. Korpela, Jan 2, 2008
    #10
  11. jodleren

    jodleren Guest

    On Jan 2, 11:32 pm, "Jukka K. Korpela" <> wrote:
    > Scripsit jodleren:
    >
    > > On Dec 23 2007, 4:14 pm, Rob Waaijenberg <>
    > > 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/


    It was meant as an answer to Rob Waaijenberg
     
    jodleren, Jan 3, 2008
    #11
  12. Scripsit jodleren:

    > On Jan 2, 11:32 pm, "Jukka K. Korpela" <> wrote:
    >> Scripsit jodleren:
    >>
    >>> On Dec 23 2007, 4:14 pm, Rob Waaijenberg
    >>> <> 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/

    >
    > It was meant as an answer to Rob Waaijenberg


    Are you completely clueless, or just making a great effort in imitating
    cluelessness?

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jan 3, 2008
    #12
  13. jodleren

    GTalbot Guest

    On 2 jan, 08:30, jodleren <> wrote:
    > On Dec 23 2007, 4:14 pm, Rob Waaijenberg <>
    > wrote:
    >


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


    Hello Jodleren,

    You should change your doctype declaration to HTML 4.01 strict and
    then correct all of the validation markup errors.

    I highly and strongly recommend
    Using Web Standards in your Web Pages:Making your page using web
    standards - how to
    http://developer.mozilla.org/en/doc...Making_your_page_using_web_standards_-_how_to

    Nested tables should always be avoided.

    The default vertical alignment in cell is middle in all modern
    browsers; so there is no need whatsoever to add valign="middle" in all
    your cells.

    <font> is a deprecated, old, rusted HTML element. Please upgrade. You
    will find how to do all this (convert bgcolor, replace <font>, how to
    validate, etc) by consulting the "Using Web Standards in your Web
    Pages" link I mentioned.

    All of your webpage indicates over-constraining, over-declaring, over-
    formating and over-attributes-specifying. You can reduce your webpage
    markup code to half of what it is easily if you read a bit and then
    keep your mind open about what people are trying to tell you in this
    forum newsgroup.

    Regards, Gérard
     
    GTalbot, Jan 4, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dalei
    Replies:
    5
    Views:
    9,865
    Neredbojias
    Aug 28, 2005
  2. shahid

    subscript and superscript

    shahid, Feb 4, 2009, in forum: C++
    Replies:
    14
    Views:
    7,732
    James Kanze
    Feb 6, 2009
  3. MBS
    Replies:
    5
    Views:
    286
  4. Shadowfirebird
    Replies:
    0
    Views:
    129
    Shadowfirebird
    Nov 19, 2010
  5. dalei

    Turning a number to superscript

    dalei, Aug 23, 2005, in forum: Javascript
    Replies:
    8
    Views:
    123
    Robert
    Aug 27, 2005
Loading...

Share This Page