From: gandalfrat on
Can anyone help me out with a problem with Matt Kruse' Javascript
toolbox script for table sort/filter?

I've got a flat spot on my forehead from the following problem:

Here's the issue:

The script works very nicely with the exception that it does the
following things:

1. The columns with filters all seem to expand to the width of the
longest entry in their column.
2. Columns with no filters get the leftovers.

Here's the example: http://oldsaw.org/temp/tbl_test/bheaclass.php

the th directive seems to be ignored (<th width="60%">Description</
th>)

The scripts are posted here and there's no doc info related to column
width settings: http://www.javascripttoolbox.com/lib/table/

It's an awesome utility... I'm just stuck.

PM'd Matt a couple of times, made a donation. No info.

Thanks for any assistance anyone can provide. Hopefully not a
neophyte mistake.

GR
From: Thomas 'PointedEars' Lahn on
gandalfrat wrote:

> Can anyone help me out with a problem with Matt Kruse' Javascript
> toolbox script for table sort/filter?

Yes, definitely: Matt. He is somewhat of a regular contributor here,
and has posted recently, so you may be lucky.

However:

> [...]
> The script works very nicely with the exception that it does the
> following things:
>
> 1. The columns with filters all seem to expand to the width of the
> longest entry in their column.
> 2. Columns with no filters get the leftovers.
>
> Here's the example: http://oldsaw.org/temp/tbl_test/bheaclass.php
>
> the th directive seems to be ignored (<th width="60%">Description</
> th>)

It is not a directive, but an element, and the W3C Markup Validator shows
60(!) errors for your generated markup (I did not even have to go there to
see it, thanks to the Web Developer extension for Firefox).

<http://validator.w3.org/check?uri=http://oldsaw.org/temp/tbl_test/bheaclass.php&ss=1;verbose=1>

> [...]
> PM'd Matt a couple of times, made a donation. No info.

Perhaps your e-mails were filtered out as spam, or he ignored you because
of that beginner's mistake.

> Thanks for any assistance anyone can provide.

You're welcome.

> Hopefully not a neophyte mistake.

Unfortunately, it is.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
From: gandalfrat on
PE wrote:

>
> It is not a directive, but an element, and the W3C Markup Validator shows
> 60(!) errors for your generated markup (I did not even have to go there to
> see it, thanks to the Web Developer extension for Firefox).
>
> <http://validator.w3.org/check?uri=http://oldsaw.org/temp/tbl_test/bhe....>

Thanks. 58 of the 60 were related to having deleted an "echo <tr>" in
the loop reading the file and building each row in the table. All
those are gone. I stil have a couple of XML validation errors but...
is that related to column width issues?

> > [...]
> > PM'd Matt a couple of times, made a donation.  No info.
>
> Perhaps your e-mails were filtered out as spam, or he ignored you because
> of that beginner's mistake.
>
> > Thanks for any assistance anyone can provide.
>
> You're welcome.
>
> > Hopefully not a neophyte mistake.
>
> Unfortunately, it is.

Any chance you can give me some pointers on which direction to look
for the column width issue?

The th element is used in several of Matt's examples on the page.
You're right, I mistakenly took it for the deprecated th directive.

I have also tried CSS manipulation of the column widths. font color
and background changes all seem to work with the application of a
style but "width" statements are ignored.

Thanks again for pointing out the above.

GR
From: Scott Sauyet on
On Mar 7, 10:21 pm, gandalfrat <gandalf...(a)gmail.com> wrote:
> The script works very nicely with the exception that it does the
> following things:
>
> 1.  The columns with filters all seem to expand to the width of the
> longest entry in their column.
> 2.  Columns with no filters get the leftovers.

As Thomas noted, Matt might well chime in here, but looking at the
generated page, my first thought would be to assign a width in CSS to
the SELECT elements in the header:

select.table-autofilter {width:100px;}

That might be all it takes, but I can't say I've tested in anything
except FF/Firebug.

-- Scott
From: Thomas 'PointedEars' Lahn on
gandalfrat wrote:

> PE wrote:
>> It is not a directive, but an element, and the W3C Markup Validator
>> shows 60(!) errors for your generated markup (I did not even have
>> to go there to see it, thanks to the Web Developer extension for
>> Firefox).
>>
>>
<http://validator.w3.org/check?uri=http://oldsaw.org/temp/tbl_test/bhe...>
>
> Thanks. 58 of the 60 were related to having deleted an "echo <tr>" in
> the loop reading the file and building each row in the table. All
> those are gone. I stil have a couple of XML validation errors

For one, you have a `tfoot' element after a `tbody' element. Strange as it
may sound, the order needs to be reversed. And you really should not be
serving XHTML as text/html; serve HTML as text/html instead.

> but... is that related to column width issues?

Very likely, yes. If the user agent cannot reliably determine where the
next row begins, a DOM script would have a hard time finding the cells
which belonged to the same column.

Does it still not work as you expect after you have fixed the markup?
And try HTML instead.

>> Unfortunately, it is.
>
> Any chance you can give me some pointers on which direction to look
> for the column width issue?

You should make your markup fully Valid first.

> The th element is used in several of Matt's examples on the page.
> You're right, I mistakenly took it for the deprecated th directive.

"Deprecated th directive"?

> I have also tried CSS manipulation of the column widths. font color
> and background changes all seem to work with the application of a
> style but "width" statements are ignored.

CSS is no programming language either. Those are _property declarations_.
And CSS issues are best discussed over at
comp.infosystems.www.authoring.stylesheets, with a clear problem
description and a reduced test case. Chances are that building the test
case helps you to solve the problem by yourself.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann