/    Sign up×
Community /Pin to ProfileBookmark

Question about tables and forms

Hello,

Just a quick question, should I layout my tabular data and forms using XHTML elements (<tr>’s, <td>’s etc… even though in some situations that is considered presentation) or should I use CSS instead?

Thanks,
John.

to post a comment
CSS

8 Comments(s)

Copy linkTweet thisAlerts:
@doodlerAug 19.2007 — The generel rule is to use CSS for presentation and (x)HTML for structure BUT that is not to say that something structured at the bottom of xHTML code will necessarily be rendered there by the browser because that depends on what/how you've told it to load (again, using CSS, if indeed you've used any).

Table can be used for presentation. But try using <div> in combination with CSS instead if you can.
Copy linkTweet thisAlerts:
@lunforgottenlauthorAug 19.2007 — well I can use either <tr>'s and <td>'s to structure my form which is an easier method but in some situations that is considered presentation and not tabular data which is structure. So following the W3C standards, should I use CSS to layout my form or XHTML elements?
Copy linkTweet thisAlerts:
@felgallAug 19.2007 — The best way is to simply apply the appropriate floats and clears to the label and input fields so as to align them next to one another the way you want. (They also need to be display:block and have an appropriate width)
Copy linkTweet thisAlerts:
@lunforgottenlauthorAug 19.2007 — yeah that make sense.... The hardest/longer path is often the most rewarding ? Thank you buddy.
Copy linkTweet thisAlerts:
@ray326Aug 20.2007 — If you go the table route then the semantics would be labels in TH and inputs in TD. Here are some articles that should be interesting.

http://search.atomz.com/search/?sp-q=forms&x=0&y=0&sp-a=sp1002d27b&sp-f=ISO-8859-1&sp-p=All&sp-k=All
Copy linkTweet thisAlerts:
@lunforgottenlauthorAug 20.2007 — yeah well if I go the table route is that ok? It is the easier way to get it done but some could say that tables are presentation and presentation should be done in CSS.... So what do professional programmers usually do, do they go for tables or CSS when laying out a <form>?
Copy linkTweet thisAlerts:
@ray326Aug 21.2007 — CSS in general.
Copy linkTweet thisAlerts:
@lunforgottenlauthorAug 22.2007 — alright thank you ?
×

Success!

Help @lunforgottenl spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...