Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default

    Can anyone tell me how to get IE5 and 6 to 'middle' text in a table cell?

    Netscape happily takes valign in the page or stylesheet but IE refuses.

    I've attached some sample html...

    Many thanks.

    www.bricksandbrass.co.uk
    Attached Files Attached Files
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  2. #2
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default

    Can anyone tell me how to get IE5 and 6 to 'middle' text in a table cell?

    Netscape happily takes valign in the page or stylesheet but IE refuses.

    I've attached some sample html...

    Many thanks.

    www.bricksandbrass.co.uk
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  3. #3
    Join Date
    Aug 2000
    Location
    South Fla
    Posts
    3,400

    Default

    Try this.

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <table width="100%" border="1" cellspacing="0" cellpadding="0">
    <tr valign="middle">
    <td bgcolor="#00FF00" width="48%" height="10">
    <p align="center">Heading 1</td>
    <td width="2%" height="10"></td>
    <td bgcolor="#00FF00" width="50%" height="10">
    <p align="center">Heading 2</td>
    </tr>
    </table>
    </body>
    </html

  4. #4
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default

    It looks a doddle; I must have a closer look to see what was going wrong.

    Very many thanks...

    www.bricksandbrass.co.uk
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  5. #5
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default

    I was using H1 (with classes from a stylesheet). The vertical alignment in IE is wrong.

    If instead you use P, with a style to replicate the format of the heading tag, then all is hunky dory.

    Sometimes you just want to scream and ....

    Thanks again, Mike, for giving me the clue. [img]/infopop/emoticons/icon_rolleyes.gif[/img]

    www.bricksandbrass.co.uk
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  6. #6
    Join Date
    Aug 2000
    Location
    NS Canada
    Posts
    212

    Default

    Glad it worked out Simon. Of course, the downside of using <p> instead of <hx> is that search engines don't give paragraph text as much weight as heading tags.

    You can get around this by adding styles to your heading tags - padding-top or bottom seems to help.

    Good luck!

    cfn ... Jen
    Jen Worden
    Web Developer
    www.meadoworks.com
    cfn ... Jen

    Jen Worden
    Web Developer
    www.meadoworks.com

  7. #7
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default

    I've just rebuilt the whole site!!!! That search engine thing is a real *****; inevitably the heading is rather significant.

    Vertical alignment in a stylesheet doesn't work on Heading tags, so I'll have to try your trick.

    Thanks...

    www.bricksandbrass.co.uk
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  8. #8
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default

    Tried that. Padding won't work because then Netscape renders it all wrong.

    Is the only solution to have browser-specific formatting?!!

    Or can I get round the search engine problem another way?

    www.bricksandbrass.co.uk
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  9. #9
    Join Date
    Aug 2000
    Location
    NS Canada
    Posts
    212

    Default

    Doh! I shoulda paid more attention!

    Try "vertical-align: middle;" for your heading tags - I tested on Netscape 4 and IE 5 and they both worked.

    Hope that does it for you, Simon.

    cfn ... Jen
    Jen Worden
    Web Developer
    www.meadoworks.com
    cfn ... Jen

    Jen Worden
    Web Developer
    www.meadoworks.com

  10. #10
    Join Date
    Sep 2000
    Location
    London, England
    Posts
    413

    Default

    You are assigning the valign propety to the <tr> tag - you should be assigning it to the <td> instead.

    <td valign="middle">

    Ed

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •