Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 24th, 2005, 12:51 AM
Dan Jacobson
Guest
 
Posts: n/a
Default HTML table position text injector?

Gentlemen, often HTML tables meant for regular monitors become hard to
keep one's place reading when viewed on small handheld devices. So
let's insert visual clues -- letters or numbers indicating what column
we are looking at -- right into the text of the table, so the user is
sure to know what column an item was in, no matter how jumbled the
table ends up.

Let's put a,b,c,d before each bus departure time:
aNurdsburg bTurdsburg cNorflewitz dBlahsville
eSoftstools fBoogerworth gSnitsville
a16:20 b16:50 c17:15 d
e18:50 f19:20 g22:00
(Blahsville to boring to stop in these days.)

One might further deal with e.g., COLSPAN="3": a-c or abc.
Multi-dimensional tables: a3, c7b etc.

HTML::TableExtract, HTML::Parser is way over my head.
Anyway perhaps somebody has already made a table position text injector?

(What I did:)
$ wget -O - http://www.fybus.com.tw/bus8.htm| #[1.6MB Big5]
tr -d \\n|perl -pwe 's/<t[dhr]/\n$&/ig'|
perl -pwe '$c=ord q{a}if/<tr/i;
s/<t[dh][^>]*>(<[^t\/][^>]*>|\&nbsp\;|\s)*/$&.chr $c++/ige'
.... plucker-build ... pilot-xfer
  #2  
Old July 24th, 2005, 12:51 AM
me
Guest
 
Posts: n/a
Default Re: HTML table position text injector?

"Dan Jacobson" <jidanni@jidanni.org> wrote in message
news:87is3r42k9.fsf@jidanni.org...[color=blue]
> Gentlemen, often HTML tables meant for regular monitors become hard to
> keep one's place reading when viewed on small handheld devices. So
> let's insert visual clues -- letters or numbers indicating what column
> we are looking at -- right into the text of the table, so the user is
> sure to know what column an item was in, no matter how jumbled the
> table ends up.
>
> Let's put a,b,c,d before each bus departure time:
> aNurdsburg bTurdsburg cNorflewitz dBlahsville
> eSoftstools fBoogerworth gSnitsville
> a16:20 b16:50 c17:15 d
> e18:50 f19:20 g22:00
> (Blahsville to boring to stop in these days.)
>
> One might further deal with e.g., COLSPAN="3": a-c or abc.
> Multi-dimensional tables: a3, c7b etc.
>
> HTML::TableExtract, HTML::Parser is way over my head.
> Anyway perhaps somebody has already made a table position text injector?
>
> (What I did:)
> $ wget -O - http://www.fybus.com.tw/bus8.htm| #[1.6MB Big5]
> tr -d \\n|perl -pwe 's/<t[dhr]/\n$&/ig'|
> perl -pwe '$c=ord q{a}if/<tr/i;
> s/<t[dh][^>]*>(<[^t\/][^>]*>|\&nbsp\;|\s)*/$&.chr $c++/ige'
> ... plucker-build ... pilot-xfer[/color]

Son, I hate to burst your bubble but I'm not waiting for a 1.6MB table to
download, most especially without a loading message to tell me if the page
even exists.
Signed,
me


  #3  
Old July 24th, 2005, 12:52 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: HTML table position text injector?

Dan Jacobson <jidanni@jidanni.org> wrote:
[color=blue]
> Gentlemen, often HTML tables meant for regular monitors become hard
> to keep one's place reading when viewed on small handheld devices.
> So let's insert visual clues -- letters or numbers indicating what
> column we are looking at -- right into the text of the table, so
> the user is sure to know what column an item was in, no matter how
> jumbled the table ends up.[/color]

In terms of HTML authoring for the WWW, which is the topic of one of
the groups you posted to, that's not feasible. You would add some stuff
that you expect to be useful in a (currently relatively small) number
of browsing situations, but you would surely mess things up in a
majority of browsing situations.

Browsers for small devices can be pretty good in working with the
limited space. I wouldn't try to do better with some page-specific or
site-specific tricky techniques that may well do things worse _also_ on
small devices.

There are several techniques in HTML to assist the identification of
table rows and columns in presenting a table, such as the scope, abbr,
headers, and axis attributes. They are not very widely known, and most
books don't describe them much, and browsers utilize them rather
little, but I would say that some of them are _still_ a better, more
constructive approach. And they are described in HTML specifications.
Minimally, I would say, you could use scope and abbr, which are fairly
to understand and use.

I think you should first decide what to aim at, then consider the
programming techniques needed to achieve that. Hence followups trimmed.
(Surely there's the possibility that technical limitations exclude some
goals or otherwise affect the primary decision. But we have so far no
evidence of that in this case - surely you can do anything in Perl.:-)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles