Tables are for tabluar data, period. If your data inside those tables would look "odd" inside a spreadsheet, then it's the wrong use of tables.

For two examples of how to use CSS-only for laying out a pretty complicate table-like page, check out these two sites I've designed. Both of them are using CGI.pm on the back-end (and mod_perl, mysql, etc. to drive content from the database); Plucker and pilot-link, and also a quick hack I did a couple of days ago with a CSS-based form (thanks to jeffa amending his reply above, grr ;). Each of them was done in validated XHTML and pure validated CSS, not a single table tag to be found anywhere.

That being said, you should really explore using CSS for what you're trying to do, simply because it has a lot more benefits than tables. Nested tables are a nightmare to maintain, and it is also a lot more code than equivalent CSS (if done right), which makes the CSS pages smaller and faster to deliver to the client. It also separates content from presentation, which allows you (the developer) to work on the site design itself, the back-end code, etc. and let your web-developers work on the look-n-feel of the site, irrespective of what your code outputs.

Also, with proper implementation of User Styles (hit the View->User Style option in your browser's menu to see the 15 different client-side-activated stylesheets on that link), you can change the layout of your page without changing any of your actual page content itself.

One thing many "designers" forget, is that not everyone has a desktop browser (text-mode browser, screen scraper), or even a desktop (cellphone, PDA, WAP), or even a monitor (blind, text-to-speech (TTS) devices), to view your page. If you want to limit your audience and increase your maintenance, tables are one way to do it.

If you must use tables to meet your goal, please review the CSS Table Model for some ideas that may help the transition to CSS in the future. Also, as dws mentioned, there is a wealth of information on tables with CGI here as well as searching for tables on SuperSearch.

Good luck, and you know you can find me on ChatterBox if you have questions or need some help designing or critiquing the site. I'm also unemployed and seeking work, so I can help you longer-term as well, if need be.


In reply to Re: CGI Tables by hacker
in thread CGI Tables by sulfericacid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.