Width argument does not work correctly

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexander Scheurer

    Width argument does not work correctly

    Hello,

    my problem is as following, I got a table like this:

    <table class=main>
    <tr>
    <td class=t11></td>
    <td class=t12></td>
    </tr>
    <tr>
    <td colspan=2></td>
    </tr>
    <tr>
    <td class=t21></td>
    <td class=t22></td>
    </tr>
    <tr>
    <td class=t31></td>
    <td class=t32></td>
    </tr>
    </table>

    The stylesheet sets the with of ".main", ".t11" and ".t22" (along with
    some other stuff not included here):
    table.main {width: 810px;}
    td.t11 {width: 150px;}
    td.t12 {width: 660px;}

    That doesn't work, and I dont know why, there is no other width agument
    that might be influencing it. I also ran it through jigsaw and its all
    valid.

    However it _does_ work when I set the width for ".t31" what confused me
    totaly.

    The complete code you can see here:


    I apologize for it not being formated that nice.

    The relevant parts are the "table.main " and "td.tvcol11 " to
    "td.tvcol32 ". When you look at the Website you can see the glitch at the
    right side in the red heading where is "Nachricht" what shows that the
    background image is being repeated as the td is not 660px wide.

    Any help is appreciated

    TIA
  • Martin Bialasinski

    #2
    Re: Width argument does not work correctly

    Alexander Scheurer <mail@aspepex.n et> wrote:
    [color=blue]
    > The stylesheet sets the with of ".main", ".t11" and ".t22" (along with
    > some other stuff not included here):
    > table.main {width: 810px;}
    > td.t11 {width: 150px;}
    > td.t12 {width: 660px;}[/color]
    [color=blue]
    > That doesn't work, and I dont know why, there is no other width
    > agument that might be influencing it. I also ran it through jigsaw
    > and its all valid.[/color]

    Your doctype sets your browsers into quirks mode, which doesn't treat
    widths the way you think. Google on doctype switching and use one
    that triggers standards compliant mode.

    Bye,
    Martin

    Comment

    • Alexander Clauss

      #3
      Re: Width argument does not work correctly

      Alexander Scheurer <mail@aspepex.n et> wrote:
      [color=blue]
      > The relevant parts are the "table.main " and "td.tvcol11 " to
      > "td.tvcol32 ". When you look at the Website you can see the glitch at the
      > right side in the red heading where is "Nachricht" what shows that the
      > background image is being repeated as the td is not 660px wide.[/color]

      This is a "bug" of the browser. Unfortunately Gecko-based browsers and
      IE do have some problems with calculating table widths. They do not
      respect the CSS specification.

      BTW: In Opera 8 and iCab 3 your table is rendered correct.

      --
      Alexander

      Comment

      • Alexander Scheurer

        #4
        Re: Width argument does not work correctly

        Martin Bialasinski wrote:[color=blue]
        > Your doctype sets your browsers into quirks mode, which doesn't treat
        > widths the way you think. Google on doctype switching and use one
        > that triggers standards compliant mode.[/color]

        Thanks alot that helped me. I now have other stuff that doesn't fit as
        it used to but if, its the standard I think I have to look into my code.

        Btw I found this:

        which led me to this:

        Comment

        • Baldy

          #5
          Re: Width argument does not work correctly


          "Alexander Scheurer" <mail@aspepex.n et> wrote in message
          news:dbans5$9lo $00$1@news.t-online.com...[color=blue]
          > Martin Bialasinski wrote:[color=green]
          > > Your doctype sets your browsers into quirks mode, which doesn't treat
          > > widths the way you think. Google on doctype switching and use one
          > > that triggers standards compliant mode.[/color]
          >
          > Thanks alot that helped me. I now have other stuff that doesn't fit as
          > it used to but if, its the standard I think I have to look into my code.
          >
          > Btw I found this:
          > http://gutfeldt.ch/matthias/articles/doctypeswitch.html
          > which led me to this:
          > http://www.w3.org/TR/html4/struct/global.html[/color]

          That and your class code needs "quotes" around it.
          You need the official CSS Reference Sheet?
          Sorry! We can't seem to find the resource you're looking for


          www


          Comment

          • Spartanicus

            #6
            Re: Width argument does not work correctly

            "Baldy" <Baldy@poof.com > wrote:
            [color=blue]
            >That and your class code needs "quotes" around it.[/color]

            XHTML requires attribute values to be quoted, HTML does not.
            [color=blue]
            >You need the official CSS Reference Sheet?
            >http://www.w3schools.com/css/css_reference.asp[/color]

            There is nothing "official" about w3schools.com, they have nothing to do
            with w3.org. In fact w3schools have a reputation for providing incorrect
            and poor quality information.

            --
            Spartanicus

            Comment

            Working...