467,074 Members | 974 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

Render <td> as display:block; ?

I have a bunch of (yet unwritten) code for a JSP tag library to
generate "tables" of data.The same tag library will be re-used to
generate a great many "complex data view" pages. In nearly all
contexts for this app, the appropriate HTML to generate is simple
<table... <td ... </tablemarkup, with CSS default rendering
applied to it. A database recordset maps quite simply column to
column, with the recordset column names used to caption the table
columns via <th>

I will be building an "entire table" tag for simple rapid prototyping,
but my intention is generally to require one tag to be embedded in the
JSP for each output "unit", typically a <td>...</td>. One of the
requirements is to make page and view design easily accessible to
coders who grok SQL and HTML / simple JSP tags, but who won't then
need to go near the Java that back-ends all this.

For a few of these columns (address etc.) it's appropriate to merge
these recordset columns into a single HTML unit (i.e. one <td>) and
separate them with <br>. Each tag will be regarded as generating "a
unit of content" in some abstract "table of data", but I don't want
the coders to think of them in terms of a "<tdgenerator tag".

In a very few cases (some of the pages) there could be very little
data involved here, even just a single row returned. I'd like to
abandon the <table>-like presentation here and use a handful of simple
<div>s or blocks, floated alongside each other.

My question is this:
Assuming I have to build the <tableand <tdgenerator, then do I
also need to build tag behaviour that will generate <divmarkup as
well? Or can I simply apply CSS of td { display: block; } and
switch it purely at the CSS presentation level, using the same

I know I can do this in principle, but what's it like for widespread
browser support out in the real world?

Platform is an intranet app that's heavily contractually tied into
just running on IE7. Naturally I want something more than this, every
credible desktop browser of recent vintage. Non-desktop or small-
screen devices aren't too significant though.
Thanks for any thoughts on this approach, or on the CSS portability.
(If I get time for a HTML prototype today, I'll put it on-line and
post a URL)
Jan 16 '08 #1
  • viewed: 2547

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by F. Da Costa | last post: by
14 posts views Thread by Zenobia | last post: by
3 posts views Thread by Yeah | last post: by
2 posts views Thread by taras.di@gmail.com | last post: by
3 posts views Thread by yawnmoth | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.