Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. HTML <table> tag</table>

HTML <table> tag</table>

Scheduled Pinned Locked Moved The Lounge
htmlcssquestion
23 Posts 18 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Miszou

    I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

    D Offline
    D Offline
    DaveyM69
    wrote on last edited by
    #10

    CSS is cool and the way to go, but if your using it, test the pages on every browser you can think of. You'd be suprised at how many display the same code differently. I often use tables to hold the page areas and CSS for everything else as if the main page layout gets screwed by some browser incompatability (normally IE) then it looks VERY amatuer.

    Dave
    BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

    1 Reply Last reply
    0
    • M Miszou

      I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

      I Offline
      I Offline
      ied
      wrote on last edited by
      #11

      Sigh... If it looks like a hammer, then it's a hammer, and can be used as a hammer. Some people might not like you using that particular -type- of hammer for hammering because it's the the wrong color or smells funny, but it'll work fine. Personally, I'll stop using <table> when they pry 'em from my cold dead hands... -- Ian

      S 1 Reply Last reply
      0
      • I ied

        Sigh... If it looks like a hammer, then it's a hammer, and can be used as a hammer. Some people might not like you using that particular -type- of hammer for hammering because it's the the wrong color or smells funny, but it'll work fine. Personally, I'll stop using <table> when they pry 'em from my cold dead hands... -- Ian

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #12

        ied wrote:

        Sigh... If it looks like a hammer, then it's a hammer, and can be used as a hammer.

        In this case, it's a rubber mallet. Beats a hammer for situations where you need a rubber mallet, not so great when you really need a hammer.

        Citizen 20.1.01

        'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

        1 Reply Last reply
        0
        • S Shog9 0

          Tables are discouraged for layout because at one time they were used for layout very, very frequently. And they caused a lot of problems, because tables were designed for... well, tabular data. They're verbose, they're inflexible, and if you're trying to design a fast page renderer that works well for all sorts of different screen sizes, input methods, etc... then tables-for-layout hamstring you. You can't just ignore a table - the contents may well make no sense if laid out in a non-tabular fashion. You can (and modern renderers do... to some extent at least) allow styles to override the default tabular layout, but you've really just added to the complexity, added to the number of bizarre edge conditions and debugging nightmares - both for you and for page designers. It's a never-ending nightmare. And it's completely unnecessary. One of the most common uses for tables was once the classic three-pane layout: one pane above, one to the side, and one containing the primary content of the page. It's easy to picture this as a table: two rows, one with one column, one with two. It's almost always an inaccurate picture though. There are no rows: the header is logically separate - while a table header might be intended to describe the table body and thus be continually visible above it even when printed, a website header may provide navigation or a logo or boilerplate and be largely unrelated to the actual page content. Same with the side column - like the one on this very site, it may have little or nothing to do with the page contents. A renderer could conceivably reorder these table "cells" without hurting the usability of the site - on a handheld device for instance, you might view them stacked or put navigation following the content to allow full use of the limited display width. Constrained by the tabular markup however, this is difficult. It's worth looking past the dogma and putting some thought into this stuff. :)

          Citizen 20.1.01

          'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

          G Offline
          G Offline
          goodideadave
          wrote on last edited by
          #13

          I am a database guy trying to wear another hat. I've had to maintain and modify web pages that used tables embedded in tables embedded in tables for layout, and it was difficult. Building an intranet app for ASP.NET and IE6, I tried the techniques in this article to create a three-pane layout using only CSS. I'm sure it was my lack of expertise in interpreting the article, but I couldn't get it to work. I gave it up and went back to table tags. Can anyone suggest a good article that might give a different slant on how to do this?

          Someone's gotta be the last to know, but why is it always me?

          S 1 Reply Last reply
          0
          • M Miszou

            I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

            R Offline
            R Offline
            Rama Krishna Vavilala
            wrote on last edited by
            #14

            Miszou wrote:

            since the table tag has been deprecated.

            That's news to me. I am a big fan of css based layouts but when data fits a tabular layout it does not make sense to use cryptic CSS just to display it as a table. In your case with teh information you have given I think a table is the ideal solution.

            Proud to be a CPHog user

            1 Reply Last reply
            0
            • M Miszou

              I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

              Steve EcholsS Offline
              Steve EcholsS Offline
              Steve Echols
              wrote on last edited by
              #15

              I've tried to go table free many times, but haven't had much (er, any) success with dynamic (i.e. stretchy) multiple column layouts in different browsers. Tables rock for that! I try to do the right thing, but if it causes migraines, I quickly revert back to what I know works, and damn the hype!


              - S 50 cups of coffee and you know it's on!

              • S
                50 cups of coffee and you know it's on!
                Code, follow, or get out of the way.
              B 1 Reply Last reply
              0
              • M Miszou

                I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

                E Offline
                E Offline
                Ennis Ray Lynch Jr
                wrote on last edited by
                #16

                use tables for tables of data and don't forget to use the thead and th tags so your tables will still work nice with css

                Need a C# Consultant? I'm available.
                Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                1 Reply Last reply
                0
                • M Miszou

                  I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

                  R Offline
                  R Offline
                  Roger Wright
                  wrote on last edited by
                  #17

                  At the risk of being redundant, there's nothing wrong with using tables for tables, nor is it deprecated. The use of tables for page formatting is deprecated, as well it should be, but back when CSS didn't work it was all we had. We've learned a bit since the days when there were 4200 computers on the Internet, and all 4200 were run by CP members. <TABLE>s are dead; long live <TABLE>s!

                  "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                  1 Reply Last reply
                  0
                  • M Miszou

                    I was laying out a new control, when my supervisor said that I had better not be using <table> tags to control the layout, since the <table> tag has been deprecated. The data is basically a list of item/value pairs. So, I jiggled around with some CSS and finally got it to look somewhat sensible (except when things in the first column are too wide to fit on one line, and then the layout just goes to Hell). I was always of the opinion that if you're laying out tabular data, that the use of tables is OK. So, should I continue to torture myself with CSS, or do I change it back to table layout? edit: screwed up the HTML formatting options and now my signature is messed up. edit2: Now my signature has completely disappeared. Whatevah...

                    R Offline
                    R Offline
                    Rocky Moore
                    wrote on last edited by
                    #18

                    For me, I use CSS as much as possible, but if a task is either way over the top in complexity (which can happen with CSS and cross-browser), then yes, I will use a table and move on. At this point and time, they have not build a full replacement for the table element with CSS that is cross-browser compatible. Many proclaim that you can easily do it all with css, but they are zelots and make much more work for the developers just to proclaim their tabeless purity. That said though, I try to use CSS as much as possible as it can be faster in some browsers, cleaner in code and easy to style. The biggest problem with browsers and web technologies is it takes five to ten years for them to set a standard and then have that standard implement across the browser. Way to slow of cycle to be effective! I think Silverlight will throw a big stick into a lot of those gears :)

                    Rocky <>< Recent Blog Post: Only answer to fuel problems

                    1 Reply Last reply
                    0
                    • P peterchen

                      Most "HTML Programmer" web developers will chant CSS, CSS, CSS, CSS. If you ask me: use tables and move on to the really important stuff. [edit] To clarify: It is possible that CSS is important for your web site. In that case, use it - even if it's harder. I don't know, I am not a web guy, and my designs suck. However, for me, "choosing the right tool" also means "choosing a tool I can use".

                      We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
                      blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist

                      modified on Wednesday, July 30, 2008 4:58 PM

                      B Offline
                      B Offline
                      Brady Kelly
                      wrote on last edited by
                      #19

                      Tables FTW! ;P When resources on using CSS for fixed layout of labels and inputs on forms are common, I'll gladly learn something new and relegate the table to nothing more than what is rendered by a Repeater or GridView control.

                      Unscrambling Eggs: Decompiling ASP.NET

                      1 Reply Last reply
                      0
                      • Steve EcholsS Steve Echols

                        I've tried to go table free many times, but haven't had much (er, any) success with dynamic (i.e. stretchy) multiple column layouts in different browsers. Tables rock for that! I try to do the right thing, but if it causes migraines, I quickly revert back to what I know works, and damn the hype!


                        - S 50 cups of coffee and you know it's on!

                        B Offline
                        B Offline
                        Brady Kelly
                        wrote on last edited by
                        #20

                        Steve Echols wrote:

                        but haven't had much (er, any) success with dynamic (i.e. stretchy) multiple column layouts in different browsers

                        Hell, I battle with that even with tables. :doh: Stretching elements to content is just done, but stretching elements to available space is always a gamble.

                        Unscrambling Eggs: Decompiling ASP.NET

                        1 Reply Last reply
                        0
                        • P peterchen

                          Most "HTML Programmer" web developers will chant CSS, CSS, CSS, CSS. If you ask me: use tables and move on to the really important stuff. [edit] To clarify: It is possible that CSS is important for your web site. In that case, use it - even if it's harder. I don't know, I am not a web guy, and my designs suck. However, for me, "choosing the right tool" also means "choosing a tool I can use".

                          We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
                          blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist

                          modified on Wednesday, July 30, 2008 4:58 PM

                          X Offline
                          X Offline
                          Xiangyang Liu
                          wrote on last edited by
                          #21

                          peterchen wrote:

                          In that case, use it - even if it's harder.

                          Reminds me of DCOM. :laugh:

                          My .NET Business Application Framework My Home Page My Younger Son & His "PET"

                          1 Reply Last reply
                          0
                          • G goodideadave

                            I am a database guy trying to wear another hat. I've had to maintain and modify web pages that used tables embedded in tables embedded in tables for layout, and it was difficult. Building an intranet app for ASP.NET and IE6, I tried the techniques in this article to create a three-pane layout using only CSS. I'm sure it was my lack of expertise in interpreting the article, but I couldn't get it to work. I gave it up and went back to table tags. Can anyone suggest a good article that might give a different slant on how to do this?

                            Someone's gotta be the last to know, but why is it always me?

                            S Offline
                            S Offline
                            Shog9 0
                            wrote on last edited by
                            #22

                            goodideadave wrote:

                            I'm sure it was my lack of expertise in interpreting the article, but I couldn't get it to work.

                            Well, to be fair, the article is a bit old now. You might want to have a look at these: http://www.gerd-riesselmann.net/development/the-holy-grail-css-layout-fix-for-ie7[^] http://www.satzansatz.de/cssd/hgjump.html[^] Sadly, IE's bizarre layout rules (and to some extent, other bugs in other browsers) have made this sort of thing much harder to do in a general sense than it should have been. If you hit a wall, post a question in the WebDev forum & we'll dig into it.

                            Citizen 20.1.01

                            'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

                            G 1 Reply Last reply
                            0
                            • S Shog9 0

                              goodideadave wrote:

                              I'm sure it was my lack of expertise in interpreting the article, but I couldn't get it to work.

                              Well, to be fair, the article is a bit old now. You might want to have a look at these: http://www.gerd-riesselmann.net/development/the-holy-grail-css-layout-fix-for-ie7[^] http://www.satzansatz.de/cssd/hgjump.html[^] Sadly, IE's bizarre layout rules (and to some extent, other bugs in other browsers) have made this sort of thing much harder to do in a general sense than it should have been. If you hit a wall, post a question in the WebDev forum & we'll dig into it.

                              Citizen 20.1.01

                              'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

                              G Offline
                              G Offline
                              goodideadave
                              wrote on last edited by
                              #23

                              Thanks.

                              Someone's gotta be the last to know, but why is it always me?

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups