Log in

View Full Version : why cant i use paragraphs in <table>?



bazmanblue
09-29-2006, 10:40 AM
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?

bazmanblue
09-29-2006, 10:46 AM
do i have to use blockqoute before putting <p>?
what about aligning images and the <a> tags?

Twey
09-29-2006, 04:56 PM
Firstly, you shouldn't be serving XHTML to clients (http://www.hixie.ch/advocacy/xhtml).

Secondly, why would you want to? Paragraphs don't go inside tables, only tabular data does.

jscheuer1
09-29-2006, 05:19 PM
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.

mwinter
09-29-2006, 08:30 PM
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

jscheuer1
09-30-2006, 02:31 AM
I might add that all of this information seems pretty good but, what you may be experiencing is something like so:


<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:


<table><tr><td><p>Hi</p></td></tr></table>

djr33
09-30-2006, 03:30 AM
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?

Twey
09-30-2006, 11:47 AM
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.

mwinter
09-30-2006, 12:20 PM
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

jscheuer1
09-30-2006, 03:29 PM
. . . 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.

Twey
09-30-2006, 03:45 PM
I did mean printed (or other finite media) pages. I saw this ambiguity earlier, but since Mike seemed to understand, I didn't bother clarifying. Sorry.