Help with a table using Strict HTML

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

    Help with a table using Strict HTML

    I inherited a simple page that needs to be Strict HTML and I'm not very
    familiar with this standard. What I'm trying to do _should be_ pretty
    simple so I hope someone can point me in the right direction.

    I'm trying to make a table with 2 columns split down the middle - simple
    enough. In the past, without Strict HTML, I would just specify the width of
    each 'cell' as 50%, but width isn't allowed in a <td> under Strict HTML.
    Sometimes I would make these 2 cells 45% with a 10% cell between them to
    make the spacing more readable. If I just remove the 'width' attribute',
    the browser splits the screen width differently depending on what's in each
    cell. Unfortunately, I need to match a format where the table is split down
    the middle.

    Is there a simple way to control the width of the columns in my tables when
    using strict HTML??

    many thanks, BT


  • Steve Pugh

    #2
    Re: Help with a table using Strict HTML

    "BT" <no@xnono.com > wrote:
    [color=blue]
    >I'm trying to make a table with 2 columns split down the middle - simple
    >enough. In the past, without Strict HTML, I would just specify the width of
    >each 'cell' as 50%, but width isn't allowed in a <td> under Strict HTML.[/color]

    <col width="50%"> or td {width: 50%;}

    Check the HTML and CSS specs if you're not sure how to apply the
    above.
    [color=blue][color=green]
    >>Sometimes I would make these 2 cells 45% with a 10% cell between them to[/color]
    >make the spacing more readable.[/color]

    Don't use empty cells, use appropriate CSS.
    [color=blue]
    >Is there a simple way to control the width of the columns in my tables when
    >using strict HTML??[/color]

    See above, but are these actually tables of data or are you just using
    tables to create layout columns?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

    Comment

    • c.thornquist

      #3
      Re: Help with a table using Strict HTML


      "BT" <no@xnono.com > wrote in message
      news:q%B2e.4325 9$Ux.12773@torn ado.texas.rr.co m...[color=blue]
      >I inherited a simple page that needs to be Strict HTML and I'm not very
      >familiar with this standard. What I'm trying to do _should be_ pretty
      >simple so I hope someone can point me in the right direction.
      >
      > I'm trying to make a table with 2 columns split down the middle - simple
      > enough. In the past, without Strict HTML, I would just specify the width
      > of each 'cell' as 50%, but width isn't allowed in a <td> under Strict
      > HTML. Sometimes I would make these 2 cells 45% with a 10% cell between
      > them to make the spacing more readable. If I just remove the 'width'
      > attribute', the browser splits the screen width differently depending on
      > what's in each cell. Unfortunately, I need to match a format where the
      > table is split down the middle.
      >
      > Is there a simple way to control the width of the columns in my tables
      > when using strict HTML??
      >
      > many thanks, BT
      >[/color]
      Don't know much about "strict" standards, but sometimes I place a row above
      or below with transparent .gifs 1 pixel high in the cells. Then set the
      width of the .gifs accordingly. Makes all the columns above or below exactly
      as you specified in those .gifs. Adobe's Image Ready does then same thing
      when you slice an image.
      Will your table borders be set to "0"? If so, you won't even see the row of
      ..gifs.

      Carla


      Comment

      • Barbara de Zoete

        #4
        Re: Help with a table using Strict HTML

        On Wed, 30 Mar 2005 18:30:37 GMT, c.thornquist <c.thornquist@i nsightbb.com>
        wrote:
        [color=blue]
        > "BT" <no@xnono.com > wrote in message
        > news:q%B2e.4325 9$Ux.12773@torn ado.texas.rr.co m...
        >[color=green]
        >> Is there a simple way to control the width of the columns in my tables
        >> when using strict HTML??
        >>[/color]
        > Don't know much about "strict" standards, but sometimes I place a row above
        > or below with transparent .gifs 1 pixel high in the cells. Then set the
        > width of the .gifs accordingly. Makes all the columns above or below exactly
        > as you specified in those .gifs. Adobe's Image Ready does then same thing
        > when you slice an image.[/color]

        How on earth is a spacer.gif ever going to be tabular data? If you think abusing
        spacer gifs in layout tables is fine for your purposes, please keep using them,
        but pointing others down that horrible faulty road is not much appreciated.

        OP should really just read on tables in the w3c specs. There he'll find that in
        html strict using the elements colgroup and col give good control over column
        width, if it needs to be set by author. In almost all situations tabular data
        will shrink or stretch a table columns width as needed, so there is no use for
        setting the width by author.


        --
        ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
        | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
        | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
        |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
        `-------------------------------------------------- --<--@ ------------'

        Comment

        • kaeli

          #5
          Re: Help with a table using Strict HTML

          In article <q%B2e.43259$Ux .12773@tornado. texas.rr.com>, no@xnono.com
          enlightened us with...[color=blue]
          >
          > Is there a simple way to control the width of the columns in my tables when
          > using strict HTML??
          >[/color]

          td.half {width: 50%; padding-left: 5px; padding-right: 5px;}

          ....

          <td class="half">

          Even better, class the table and provide CSS for the whole thing.
          Strict requires separation of presentation and content. You have to use CSS.

          Like so...

          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
          "http://www.w3.org/TR/html4/strict.dtd">
          <html>
          <head>
          <title>Untitl ed Document</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          <style type="text/css">
          table.even {
          width: 85%;
          border: 1px solid #686868;
          border-collapse: collapse;
          }
          table.even TH{
          font-weight: bold;
          text-align: center;
          border: 1px solid #686868;
          border-collapse: collapse;
          padding: 0px;
          margin: 0px;
          }
          table.even TD{
          width: 50%;
          border: 1px solid #686868;
          border-collapse: collapse;
          padding-left: 5px;
          padding-right: 5px;
          padding-top: 0;
          padding-bottom: 0;
          margin: 0px;
          }

          </style>
          </head>

          <body>
          <table class="even">
          <tr>
          <th>header 1</th>
          <th>header 2</th>
          </tr>
          <tr>
          <td>data</td>
          <td>more data</td>
          </tr>
          <tr>
          <td>yet more data</td>
          <td>and more</td>
          </tr>
          </table>
          </body>
          </html>

          --
          --
          ~kaeli~
          A backward poet writes... inverse.



          Comment

          • Del Ferguson

            #6
            Re: Help with a table using Strict HTML

            BT,

            Strictly my version as follows. Passes XHTML validation. Looks OK in
            either FF or IE. Control colors, background, etc., with CSS.

            Del Ferguson

            <?xml version="1.0"?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <title>Test Table</title>
            </head>
            <body>
            <table width="100%" border="1" cellspacing="0" cellpadding="5" summary="Test
            Table">
            <colgroup span="2">
            <col width="50%" />
            <col width="50%" /></colgroup>
            <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            </tr>
            </table>
            </body>
            </html>

            "BT" <no@xnono.com > wrote in message
            news:q%B2e.4325 9$Ux.12773@torn ado.texas.rr.co m...[color=blue]
            >I inherited a simple page that needs to be Strict HTML and I'm not very
            >familiar with this standard. What I'm trying to do _should be_ pretty
            >simple so I hope someone can point me in the right direction.
            >
            > I'm trying to make a table with 2 columns split down the middle - simple
            > enough. In the past, without Strict HTML, I would just specify the width
            > of each 'cell' as 50%, but width isn't allowed in a <td> under Strict
            > HTML. Sometimes I would make these 2 cells 45% with a 10% cell between
            > them to make the spacing more readable. If I just remove the 'width'
            > attribute', the browser splits the screen width differently depending on
            > what's in each cell. Unfortunately, I need to match a format where the
            > table is split down the middle.
            >
            > Is there a simple way to control the width of the columns in my tables
            > when using strict HTML??
            >
            > many thanks, BT
            >[/color]


            Comment

            • c.thornquist

              #7
              Re: Help with a table using Strict HTML


              "Barbara de Zoete" <b_de_zoete@hot mail.com> wrote in message
              news:opsogrn1ob x5vgts@zoete_b. ..[color=blue]
              > On Wed, 30 Mar 2005 18:30:37 GMT, c.thornquist
              > <c.thornquist@i nsightbb.com> wrote:
              >[color=green]
              >> "BT" <no@xnono.com > wrote in message
              >> news:q%B2e.4325 9$Ux.12773@torn ado.texas.rr.co m...
              >>[color=darkred]
              >>> Is there a simple way to control the width of the columns in my tables
              >>> when using strict HTML??
              >>>[/color]
              >> Don't know much about "strict" standards, but sometimes I place a row
              >> above
              >> or below with transparent .gifs 1 pixel high in the cells. Then set the
              >> width of the .gifs accordingly. Makes all the columns above or below
              >> exactly
              >> as you specified in those .gifs. Adobe's Image Ready does then same thing
              >> when you slice an image.[/color][/color]

              <snip>

              In almost all situations tabular data[color=blue]
              > will shrink or stretch a table columns width as needed, so there is no use
              > for setting the width by author.
              >
              >
              >[/color]

              Sometimes you don't want the text to stretch beyond a width that is
              comfortable to read. Is there a rule against using tables for anything other
              than tabular data? If so, what is the rule and why was it established?

              Carla


              Comment

              • Barbara de Zoete

                #8
                Re: Help with a table using Strict HTML

                On Wed, 30 Mar 2005 18:55:03 GMT, c.thornquist <c.thornquist@i nsightbb.com>
                wrote:
                [color=blue][color=green]
                >> On Wed, 30 Mar 2005 18:30:37 GMT, c.thornquist
                >> <c.thornquist@i nsightbb.com> wrote:
                >>[color=darkred]
                >>> Don't know much about "strict" standards,[/color][/color][/color]
                [color=blue]
                > Is there a rule against using tables for anything other
                > than tabular data? If so, what is the rule and why was it established?
                >[/color]

                I suggest you too read up on w3c standards.


                --
                ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
                | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
                | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
                |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
                `-------------------------------------------------- --<--@ ------------'

                Comment

                • Adrienne

                  #9
                  Re: Help with a table using Strict HTML

                  Gazing into my crystal ball I observed "c.thornqui st"
                  <c.thornquist@i nsightbb.com> writing in
                  news:bCC2e.1195 88$Ze3.20492@at tbi_s51:
                  [color=blue]
                  > Sometimes you don't want the text to stretch beyond a width that is
                  > comfortable to read. Is there a rule against using tables for anything
                  > other than tabular data? If so, what is the rule and why was it
                  > established?
                  >
                  >[/color]

                  http://www.w3.org/TR/WAI-WEBCONTENT/#gl-table-markup and


                  --
                  Adrienne Boswell

                  Please respond to the group so others can share

                  Comment

                  • c.thornquist

                    #10
                    Re: Help with a table using Strict HTML


                    "Barbara de Zoete" <b_de_zoete@hot mail.com> wrote in message
                    news:opsogsa11w x5vgts@zoete_b. ..[color=blue]
                    > On Wed, 30 Mar 2005 18:55:03 GMT, c.thornquist
                    > <c.thornquist@i nsightbb.com> wrote:
                    >[color=green][color=darkred]
                    >>> On Wed, 30 Mar 2005 18:30:37 GMT, c.thornquist
                    >>> <c.thornquist@i nsightbb.com> wrote:
                    >>>
                    >>>> Don't know much about "strict" standards,[/color][/color]
                    >[color=green]
                    >> Is there a rule against using tables for anything other
                    >> than tabular data? If so, what is the rule and why was it established?
                    >>[/color]
                    >
                    > I suggest you too read up on w3c standards.
                    >[/color]

                    I know what the w3c recommends re tables. That they only be used for tabular
                    data. But there must be thousands of people in the industry who disagree
                    with them re tables, since they are used on huge, prominent news sites and
                    by companies like Adobe. I like tables because they allow precise control
                    over
                    placement on the page. And they are fun to build with. Kind of like working
                    with Legos:)

                    I am concerned with accessibility and tables and need to read more about it
                    at w3.org's site. They have a good section on how to create tables that are
                    accessible.

                    What I should have said is "there is no rule against using tables for
                    informational text and/or images, but the w3c frowns upon using them in that
                    manner."

                    Carla


                    Comment

                    • Michael Winter

                      #11
                      Re: Help with a table using Strict HTML

                      On 30/03/2005 19:55, c.thornquist wrote:

                      [snip]
                      [color=blue]
                      > Sometimes you don't want the text to stretch beyond a width that is
                      > comfortable to read.[/color]

                      If that's the case, then specify a max-width for the relevant element.
                      [color=blue]
                      > Is there a rule against using tables for anything other than tabular data?[/color]

                      If you're going to author a document to the Strict DTD, you should
                      work toward the spirit of the document type. That is, use elements for
                      what they were intended. If you want to use elements for their
                      presentational properties, then just stick to Transitional.

                      [snip]

                      Mike

                      --
                      Michael Winter
                      Replace ".invalid" with ".uk" to reply by e-mail.

                      Comment

                      • Adrienne

                        #12
                        Re: Help with a table using Strict HTML

                        Gazing into my crystal ball I observed "c.thornqui st"
                        <c.thornquist@i nsightbb.com> writing in
                        news:lVC2e.1170 27$r55.8960@att bi_s52:
                        [color=blue]
                        >
                        > "Barbara de Zoete" <b_de_zoete@hot mail.com> wrote in message
                        > news:opsogsa11w x5vgts@zoete_b. ..[color=green]
                        >> On Wed, 30 Mar 2005 18:55:03 GMT, c.thornquist
                        >> <c.thornquist@i nsightbb.com> wrote:
                        >>[color=darkred]
                        >>>> On Wed, 30 Mar 2005 18:30:37 GMT, c.thornquist
                        >>>> <c.thornquist@i nsightbb.com> wrote:
                        >>>>
                        >>>>> Don't know much about "strict" standards,[/color]
                        >>[color=darkred]
                        >>> Is there a rule against using tables for anything other
                        >>> than tabular data? If so, what is the rule and why was it
                        >>> established?
                        >>>[/color]
                        >>
                        >> I suggest you too read up on w3c standards.
                        >>[/color]
                        >
                        > I know what the w3c recommends re tables. That they only be used for
                        > tabular data. But there must be thousands of people in the industry who
                        > disagree with them re tables, since they are used on huge, prominent
                        > news sites and by companies like Adobe. I like tables because they
                        > allow precise control over
                        > placement on the page. And they are fun to build with. Kind of like
                        > working with Legos:)
                        >
                        > I am concerned with accessibility and tables and need to read more
                        > about it at w3.org's site. They have a good section on how to create
                        > tables that are accessible.
                        >
                        > What I should have said is "there is no rule against using tables for
                        > informational text and/or images, but the w3c frowns upon using them in
                        > that manner."
                        >
                        > Carla
                        >
                        >
                        >[/color]

                        As a developer, I find tables a PITA to work with, especially when they are
                        nested. It's bad enough getting a script to loop through the correct
                        records, let alone using a table for layout purposes.

                        I worked on at a large site a few years ago, and converted most of the
                        pages from tables to CSS. It probably took me about a month to get all the
                        pages done, and that was with regular coding maintenance. Each time I made
                        an edit on a page, I would convert it.

                        I would imagine some of the "big" sites don't have the time, resources, or
                        desire to make the conversion. If it ain't broken, don't fix it. That's
                        just fine, because eventually, it will be broken and they will have to fix
                        it.

                        Some of them are probably still in that "java mouseovers are the best"
                        mentality. I had to explain to someone the other day that what they were
                        looking at was not java, but javascript. The person shrugged and said,
                        "whatever it's called, I like it". And this was a person who probably
                        knows the difference.
                        --
                        Adrienne Boswell

                        Please respond to the group so others can share

                        Comment

                        • BT

                          #13
                          Re: Help with a table using Strict HTML

                          I think that I answered my own question. I tried colgroup/col with the info
                          inserted after the <table> and before the <tr> as follows:

                          <table>
                          <COLGROUP>
                          <COL width="45%">
                          <COL width="10%">
                          <COL width="45%">
                          </colgroup>
                          <tr><td>

                          Seems to work. Please feel free to comment.

                          cheers, BT

                          "BT" <no@xnono.com > wrote in message
                          news:q%B2e.4325 9$Ux.12773@torn ado.texas.rr.co m...[color=blue]
                          >I inherited a simple page that needs to be Strict HTML and I'm not very
                          >familiar with this standard. What I'm trying to do _should be_ pretty
                          >simple so I hope someone can point me in the right direction.
                          >
                          > I'm trying to make a table with 2 columns split down the middle - simple
                          > enough. In the past, without Strict HTML, I would just specify the width
                          > of each 'cell' as 50%, but width isn't allowed in a <td> under Strict
                          > HTML. Sometimes I would make these 2 cells 45% with a 10% cell between
                          > them to make the spacing more readable. If I just remove the 'width'
                          > attribute', the browser splits the screen width differently depending on
                          > what's in each cell. Unfortunately, I need to match a format where the
                          > table is split down the middle.
                          >
                          > Is there a simple way to control the width of the columns in my tables
                          > when using strict HTML??
                          >
                          > many thanks, BT
                          >[/color]


                          Comment

                          • Harlan Messinger

                            #14
                            Re: Help with a table using Strict HTML

                            c.thornquist wrote:
                            [color=blue]
                            >
                            > Sometimes you don't want the text to stretch beyond a width that is
                            > comfortable to read. Is there a rule against using tables for anything other
                            > than tabular data? If so, what is the rule and why was it established?[/color]

                            The "rule" comes from an understanding of the intent behind the design
                            of HTML. It's a markup language, a way of describing data. The data
                            consists of the parts of a document. In HTML, documents are defined to
                            consist of a head and a body, and the body is defined to include such
                            elements as paragraphs, divisions, headings, lists, tables, and forms.
                            The markup is supposed to reflect this division of a document into these
                            components.

                            A table is a two-dimensional matrix of tabular data, with a meaningful
                            organization into rows and columns. Using a table element to lay out
                            text "works", but it implies that the information in its cells is
                            tabular data. If it isn't, you're basically lying. The layout may be
                            what you want, but that's not what the markup is technically *for*. HTML
                            markup is intended to describe content, not presentation.

                            Comment

                            • Leif K-Brooks

                              #15
                              Re: Help with a table using Strict HTML

                              c.thornquist wrote:[color=blue]
                              > What I should have said is "there is no rule against using tables for
                              > informational text and/or images, but the w3c frowns upon using them in that
                              > manner."[/color]

                              "There is no rule -- unless, of course, you count the rule that's in
                              HTML's official standards." Right.

                              Comment

                              Working...