Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #20191
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Alignment of three tables |
| Date | 2013-06-10 09:08 -0600 |
| Message-ID | <b1m8g6Fjnc5U1@mid.individual.net> (permalink) |
| References | <b1jivmF20mgU1@mid.individual.net> <kp2n16$ror$1@dont-email.me> <9415734.fqrm2ecmqt@PointedEars.de> |
Denis and Thomas said:
> snip <
> Or in ECMAScript/DOM, if the third-best technique must be used:
>
> var widths = [95, 150, 150, 10, 95, 150, 150];
> var tables = document.getElementsByTagName("table");
> for (var i = 0,
> len = tables && tables.length;
> i < len;
> ++i)
> {
> for (var j = 0,
> cells = tables[i].rows[0].cells,
> len2 = cells.length;
> j < len2;
> ++j)
> {
> cells[j].style.width = cwidths[k] + "px";
> }
> }
>
> A table column is in general always as wide as the widest cell of the
> column. Defining the CSS-width of the cells of other rows than the first
> row (of a table body), too, has *no* (positive) effect.
>
Hi Thomas & Denis:
Thank you both for your suggestions.
(To my clients, the three tables look like *one* table with an
always-visible top row, and an always visible bottom row, and up to 1500
data rows between them)
I will re-build my three tables acccoding to the 'third-best' technique
(because I understand it better), and strip out all the 'width' stuff from
the <table> definitions and place it in my JavaScript.
However, I am now trying to remove as much of the 'px' stuff as I can,
and replace most sizing with 'em' and '%' definitions.
My three 'tables' are :
- A top table of one <thead> section with one <tr> row *only* (of
five <th> columns). This 'table' serves as an *always-visible* caption-like
row for the middle table. I do not use the <caption> tag because it
disapears on scrolling the middle table
- A middle table of data of data with up to nearly 1500 rows (of
five columns) containing all the data, and finishing with a <tfoot> section
of one <tr> row with five <th> columns . This table always has a scroll-bar
on the right-side to traverse the (up to) 1500 rows
- A bottom table of one <thead> section with one <tr> row, and
five <th> columns. Two of the <th> columns serve as searh <input> text
fields. This table serves as the always-visible means of quickly searching
for values in the main table above it.
So, I'll try to remove all my width stuff from the tables, and place
them in an onload JS function. Because I'm building for the DocType HTML5
now, I want to replace a lot of my 'px' sizing with 'em' or '%' -- as I
mentioned above.
Thanks again.
-Mel
I
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Alignment of three tables "Mel Smith" <med_cutout_syntel@aol.com> - 2013-06-09 08:49 -0600
Re: Alignment of three tables Scott Sauyet <scott.sauyet@gmail.com> - 2013-06-09 08:18 -0700
Re: Alignment of three tables Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-09 20:02 +0000
Re: Alignment of three tables "Mel Smith" <med_cutout_syntel@aol.com> - 2013-06-09 15:01 -0600
Re: Alignment of three tables Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-09 22:50 +0000
Re: Alignment of three tables Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-10 00:46 +0200
Re: Alignment of three tables John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-10 14:41 +0100
Re: Alignment of three tables Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-10 17:35 +0200
Re: Alignment of three tables "Mel Smith" <med_cutout_syntel@aol.com> - 2013-06-10 09:08 -0600
Re: Alignment of three tables "Mel Smith" <med_cutout_syntel@aol.com> - 2013-06-10 11:16 -0600
Re: Alignment of three tables Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-11 02:05 +0000
Re: Alignment of three tables Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-11 05:09 +0200
Re: Alignment of three tables "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-06-11 10:59 +0200
Re: Alignment of three tables Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-11 16:51 +0200
Re: Alignment of three tables Stefan Weiss <krewecherl@gmail.com> - 2013-06-14 15:38 +0200
Re: Alignment of three tables Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-14 20:26 +0200
Re: Alignment of three tables Stefan Weiss <krewecherl@gmail.com> - 2013-06-14 21:22 +0200
Re: Alignment of three tables Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-15 00:36 +0200
Re: Alignment of three tables Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-15 12:04 +0200
Re: Alignment of three tables Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-15 11:41 +0200
Re: Alignment of three tables Stefan Weiss <krewecherl@gmail.com> - 2013-06-15 13:53 +0200
Re: Alignment of three tables Scott Sauyet <scott.sauyet@gmail.com> - 2013-06-17 04:28 -0700
Re: Alignment of three tables "Andy" <andy@NOSPAMmanyplay.com> - 2013-06-10 09:19 +0100
Re: Alignment of three tables Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-06-12 18:56 +0100
csiph-web