Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: why cant i use paragraphs in <table>?

  1. #1
    Join Date
    Sep 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default why cant i use paragraphs in <table>?

    im using dreamweaver and created tables and it tells me that i cant use anything like <p> or <a> or hardly anything in xhtml for it to be verified.
    so how do people use tables in xhtml?

  2. #2
    Join Date
    Sep 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    do i have to use blockqoute before putting <p>?
    what about aligning images and the <a> tags?

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Firstly, you shouldn't be serving XHTML to clients.

    Secondly, why would you want to? Paragraphs don't go inside tables, only tabular data does.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by bazmanblue
    im using dreamweaver and created tables and it tells me that i cant use anything like <p> or <a> or hardly anything in xhtml for it to be verified.
    so how do people use tables in xhtml?
    Very infrequently.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by bazmanblue
    im using dreamweaver and created tables and it tells me that i cant use anything like <p> or <a> or hardly anything in xhtml for it to be verified.
    Unlikely.

    so how do people use tables in xhtml?
    Exactly the same way they do (or at least should) in HTML: to mark up tabular data.

    do i have to use blockqoute before putting <p>?
    Only if the paragraph contains a quotation. The blockquote element marks up a large quotation, such as the sort you normally see in printed material that is preceeded by a colon in the introducing paragraph, indented, presented without quotation marks, and is several lines long.

    what about aligning images and the <a> tags?
    That falls to CSS, as should all presentation matters. Markup is, simply put, about "describing" document content - indicating what's a paragraph, what's a heading, what's a list, etc. CSS is about presenting it.

    Mike

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I might add that all of this information seems pretty good but, what you may be experiencing is something like so:

    HTML Code:
    <table><p>
    That's a big no no in all markup. Once you open a table, you need a row and a cell before using anything else:

    HTML Code:
    <table><tr><td><p>Hi</p></td></tr></table>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Not exactly on topic, but I've noticed that dreamweaver also opens (then closes) a <tbody> tag right after the table tag. What is this? Why? What purpose could it possibly serve, and should that be added to the list?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The <thead> and <tbody> tags are used to distinguish between the main body of the table and the "head" of the table. This could, for example, not be scrolled with the rest of the table, or be repeated if the table spans more than one page.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Twey's quite right.

    All tables have at least one "body" table section. The opening and closing tags are both optional, so if the table only needs that one section, the body can be implied. If additional sections are required (two or more "bodies", or a "head" or "foot" section), the tbody elements must be included explicitly.

    Mike

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    . . . if the table spans more than one page.
    This is a new one on me. I claim ignorance and am curious how a table can span more than one page, unless you mean printed pages, not HTML pages.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •