table column width control question

C

coolsti

How do I do this?

I am presenting tabular data via a web interface. The browsers are the
latest IE and Firefox. The number of columns of data is too large to fit
on the page, so horizontal scrolling will be needed.

I want to be able to hide blocks of rows of the table when the user
clicks on certain icons and I can do this using <div> tags and some
javascript. But to do this, it seems I need to have each <div> enclose an
entire table instead of only a collection of rows within a table.

Because of the above, the data I want to show is arranged in several
tables, and these tables are set up as rows in an outer table.

The problem I have is this: I am trying to specify the column widths so
that all the data is aligned in all the tables. But since I have
horizontal scrolling, the browser does not seem to use the pixel widths
that I am giving in <td> tags. So the columns from one table do not line
up with the columns of another.

Does anyone know how I can force the browser to accept the pixel widths in
this case? Alternatively, does anyone know how the data can be placed into
one big table, but so that I can "hide" blocks of rows?

Thanks for any help!

Steve, Denmark
 
N

Neredbojias

With neither quill nor qualm, coolsti quothed:
Does anyone know how I can force the browser to accept the pixel widths in
this case? Alternatively, does anyone know how the data can be placed into
one big table, but so that I can "hide" blocks of rows?

It would seem to me you could id each row and javascript any combination
of them to display:none; However, having never tried this myself, I
could just be talking out of my food hole. Maybe I'll mess around with
it later.
 
T

Travis Newbury

coolsti said:
I am presenting tabular data via a web interface. The browsers are the
latest IE and Firefox.

Let me be the first to say... How do you know?
Does anyone know how I can force the browser to...

Yes, use Flash or Java. If you want the page to look exactly the same
everywhere, use something that does that. You can only suggest a layout
with html, css and scripting. (albeit almost everyone follows the
suggestions)
Alternatively, does anyone know how the data can be placed into
one big table, but so that I can "hide" blocks of rows?

Point to what ever rows you want to hide and do this:

MyRowID.style.display="none";
 
C

coolsti

Hi and thanks to the (so far) two replies!
Let me be the first to say... How do you know?

Well, its a very very closed audience. It is a database application
developed for my company. The company is small, and access to this
application is only possible from within our intranet. We are therefore
able to dictate which browsers this application will work on. Not to say
that an extension to another browser would not be possible, but we are not
in the position to consider this at the moment, nor do we need to.

I didn't know it was possible to get a table's row to hide itself, as the
two poster's suggest. Thanks! I will try that now!

Regards,
Steve
 
?

=?ISO-8859-1?Q?G=E9rard_Talbot?=

coolsti a écrit :

[snipped]
I want to be able to hide blocks of rows of the table when the user
clicks on certain icons and I can do this using <div> tags and some
javascript.

[snipped]

(...) how the data can be placed into
one big table, but so that I can "hide" blocks of rows?

It's also possible for block of rows (thead, tfoot, tbody) and also
colgroups. I strongly recommend not to use div, not to use extra tables
or wrapping tables. You need none of that.

Interactive demo page on table column and table row collapse and
visibility in DOM 2 compliant browsers
http://www.gtalbot.org/DHTMLSection/TableRowColumnCollapse.html

DOM level 1 Dynamic table formatting
http://www.gtalbot.org/DHTMLSection/DynamicTableFormatting.html

2 important issues:
- avoid border-collapsed table as much as possible because there are
right now too many bugs to consider in current modern browsers
- row (and/or rowgroup) collapsing is easier to code and a bit better
supported by modern browsers than/compared to column and colgroup
collapsing.

Gérard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top