OK, so I've been reading about CSS, and how in XHTML 1.0 the <table> tag is supposed to be "deprecated" and the World Wide Web consortium is trying to move developers away from the <table> tag completely, and into CSS based positioning.

After reading tons of CSS tutorials and positioning guides I was finally able to come up with a basic layout that doesn't use a single table (http://www.examancer.com/test.html), but I still have one huge problem:

Lets say I'm displaying a list of threads in a forum, and I want to display the thread title, the number of views, the number or replies, and the thread author all on the same line/row, but I want all the columns of all the rows to line up. How would I go about doing THAT in CSS? I can't seem to find an easy way.

    It sounds like you're wanting to display tabular data. In that case, you'd use the <table> tag. And <tr>, <td>, <th>, <thead>, <tbody>, <tfoot>, <caption>, <col>, <colgroup>....

      they didn't depricate the table tag they depricate a bunch or the table tags attributes that have been abused to use hidden tables for positioning.

      CSS positioning is a big of a pain in the ass because you have to use multiple style sheets with very minor differences. But once that's done you're okay.

      I develop only using a single browser and then when I'm all done developing I test on as many browsers and OS's as I can get my hands on. Usually I can trim the style sheets down to 2 or 3 but I've had as many as 15 for a single site.

        Originally posted by Weedpacket
        It sounds like you're wanting to display tabular data. In that case, you'd use the <table> tag. And <tr>, <td>, <th>, <thead>, <tbody>, <tfoot>, <caption>, <col>, <colgroup>....

        Your age is showing, Weed. They've deprecated their perspective. The replacement is that of positioning with tables is a sign of bad coding.

        I swear, I swear I read it somewhere.

        Honest though. Tables aren't supposed to be used for positioning. I only do it because I'm trying to be a rebel and all.

          Oh, well, I'm sure you could come up with something involving a buncha divs and positioning, but it still sounds like a table to me: rows and columns and uncle Tom Cobbley and all.

            I'm pretty sure Weedpacket and Drawmack are right. The table tag is alive and well - but the attributes such as alignment should be replaced by CSS. I haven't heard that tables in themselves are on the way out. In fact, I'm pretty sure that's not true.

            Norm

              Observe that XHTML1.0 derives all its semantics from HTML 4; and for the most part is described in terms of how it differs from HTML4.01 (which I linked to). I had to link to the HTML spec because the XHTML spec does not mention <table>s any more than it mentions <form>s (the implication being that both tags are equally valid in both formats).

                I used tables to position things on my site...kill me 😉

                  The problem with not coding to current standards is that one day in the near future your site may not work and then you'll be bitchin - so just code to the standards and avoid the headaches. It's really not hard to code to the standards once you know thme http://www.w3c.org.

                    Merve, nobody is going to kill you. But you might find in the near future that you will want to shoot yourself if you have to go and change your pages. If not, more power to you. The idea of web standards is to make things easier for you, not to give everyone else a reason to mock you. If you are comfortable with using HTML the way you do, good for you. That's all that matters.

                    The idea is to get away from using width, align, empty cells, and blank gifs to position your data on the page. If all you are using tables for is sectioning off your website to position all the elements, that's what web standards are attempting to get you away from.

                    Instead, you should use <div> tags an use CSS to position them on the page using margins, padding, borders, etc.

                    If you are pulling a bunch of data from a database and need to display it in tabular format, then by all means, use a table. Then you can use CSS to format the data in those tables, as well as the table itself (including widths, padding, colors, fonts, and more).

                    An example is my sample page where I pull information from my database about my tables. I put the data in tables and format the fonts and colors to make it easy to read. However, to do the tabs on the page, I am using CSS on <div> and <span> tags, NOT tables. If you look at the HTML source of the page, you'll see that it is relatively clean and easy to read.

                      looks like tables to me.....

                      <ot>seeing as this is the EL, might as well take note of the fact taht we're over 1/8th of the way to 100,00 posts.......</ot>

                        Perhaps you misunderstood me, Moonglobe. On that page, I AM using tables, to display information about my database tables in an easy-to-read format. Some would think that the tabs at the top (Short, Full, and Source) and other elements on the page are in tables. By looking at the HTML source, you can see that they are not.

                        In other words, tables are ok to use as long as it is just to lay out data in an easy to read format. They are not supposed to be used to lay out and position elements on your page. Make sense?

                          Originally posted by BuzzLY
                          Merve, nobody is going to kill you. But you might find in the near future that you will want to shoot yourself if you have to go and change your pages. If not, more power to you. The idea of web standards is to make things easier for you, not to give everyone else a reason to mock you. If you are comfortable with using HTML the way you do, good for you. That's all that matters.

                          The idea is to get away from using width, align, empty cells, and blank gifs to position your data on the page. If all you are using tables for is sectioning off your website to position all the elements, that's what web standards are attempting to get you away from.

                          Instead, you should use <div> tags an use CSS to position them on the page using margins, padding, borders, etc.

                          If you are pulling a bunch of data from a database and need to display it in tabular format, then by all means, use a table. Then you can use CSS to format the data in those tables, as well as the table itself (including widths, padding, colors, fonts, and more).

                          An example is my sample page where I pull information from my database about my tables. I put the data in tables and format the fonts and colors to make it easy to read. However, to do the tabs on the page, I am using CSS on <div> and <span> tags, NOT tables. If you look at the HTML source of the page, you'll see that it is relatively clean and easy to read.

                          I'm not talking about my homepage, and I'm certainly not going to use blank gifs! I'm talking about my online calculator and my madlib. My homepage would look absolutely positively crappy without tables!, whereas, I see your point about tables for positioning. When I get the chance (winter hols) I'll change all of that and remodel the stuff that sucks...I know what you mean about XHTML and stuff, and I have no problem with closing <p> tags and using CSS to position the stuff on the frontpage (not the homepage). I am not the enemy of CSS or XHTML and I'm willing to type <br /> if it gets me out of trouble. I am also willing to close my <p> tags and <li> tags.

                          I know what you mean about HTML being very...umm...broken...can't think of a better word. HTML is very...ummm...easy to learn. You can learn the basics in an hour. The point is, when I first got introduced to XHTML, I thought...what a load of BS! but now I know the truth and you friendly dudes have shown me the light!

                          And I'll make the necessary updates...when time comes to do so!

                          //End Merve's rant about nothing

                            Originally posted by Weedpacket
                            Oh, well, I'm sure you could come up with something involving a buncha divs and positioning, but it still sounds like a table to me: rows and columns and uncle Tom Cobbley and all.

                            You know, it was my age that was showing. I was referrring to something I read a few weeks ago. I misunderstood it the first time I read it and that's what stuck in my head. They were referring to doing text indents with tables.

                            Sorry all. My mind just isn't what it used to be 🙁

                            😃

                              Were they referring to doing something like

                              p:first-letter
                              {	padding-left:5em;
                              }
                              

                              ?

                                Write a Reply...