473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Forcing table cells to stack vertically

By defining a style as follows:

@media aural, handheld {td.layout {display:block;}}

I'm hoping to linearise layout tables when viewed by screenreaders and
handheld devices (it is also be in some selectable user preferences).

This works as intended in Netscape 7 - all the cells stack vertically above
each other nicely, but not in Internet Explorer 6 where the only display
property that td will respond to seems to be 'none'.

I need to keep the layout tables for legacy reasons, is there any way of
doing this and using CSS to stack all the cells vertically in IE?

Thanks
Finn
Jul 20 '05 #1
6 7684
"Finn Newick" <fi*********@menai.ac.uk> wrote:
By defining a style as follows:

@media aural, handheld {td.layout {display:block;}}

I'm hoping to linearise layout tables when viewed by screenreaders
Um, why? The above code will place the table cells one after the other
in the order they appear in the source code. Do you think that a
screenreader would do anything different by default?
and handheld devices
Handheld devices vary a great deal, some of the can cope with the same
sorts of layouts as deslktop computers, others are much more like text
browsers (which will usually linearise the table just like a
screenreader will), others are in between. Whether any of them support
media handheld is another matter.
(it is also be in some selectable user preferences).
Already built into some browsers (e.g. Opera) but this seems to be the
meat of your question, so let's proceed...
This works as intended in Netscape 7 - all the cells stack vertically above
each other nicely, but not in Internet Explorer 6 where the only display
property that td will respond to seems to be 'none'.
Yep, seems to be the case. IE is rubbish isn't it?
I need to keep the layout tables for legacy reasons, is there any way of
doing this and using CSS to stack all the cells vertically in IE?


I can't think of a pure CSS solution. You could use the DOM to
dynamically remove the table markup and replace it with divs. Or you
could take the height of the cells (again by querying the DOM) and use
that to generate absolutrely positioned co-ordinates for the cells.
Those options are a bit complicated and messy. I think you're out of
luck.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
Thanks for the reply (and apologies for the weird double posting).
I'm hoping to linearise layout tables when viewed by screenreaders
Um, why? The above code will place the table cells one after the other
in the order they appear in the source code. Do you think that a
screenreader would do anything different by default?


There are two types of screenreaders, ones which actually work a bit like
web browsers and will indeed linearise tables, and ones that are genuinely
reading the screen. Some of the latter can get confused with columns of text
adjacent to each other. Thankfully I think these are fairly rare now, but I
was hoping to give those visitors the option of adjusting the columns.
and handheld devices


Handheld devices vary a great deal, some of the can cope with the same
sorts of layouts as deslktop computers, others are much more like text
browsers (which will usually linearise the table just like a
screenreader will), others are in between. Whether any of them support
media handheld is another matter.


I'm be using a server generated CSS sheet for those browsers that don't
support aural (do any?) or handheld media statements so that users can
define how the page behaves (along with colours, font size etc).
(it is also be in some selectable user preferences).


Already built into some browsers (e.g. Opera) but this seems to be the
meat of your question, so let's proceed...


True, and I wish they all did!
This works as intended in Netscape 7 - all the cells stack vertically aboveeach other nicely, but not in Internet Explorer 6 where the only display
property that td will respond to seems to be 'none'.


Yep, seems to be the case. IE is rubbish isn't it?
I need to keep the layout tables for legacy reasons, is there any way of
doing this and using CSS to stack all the cells vertically in IE?


I can't think of a pure CSS solution. You could use the DOM to
dynamically remove the table markup and replace it with divs. Or you
could take the height of the cells (again by querying the DOM) and use
that to generate absolutrely positioned co-ordinates for the cells.
Those options are a bit complicated and messy. I think you're out of
luck.


Yep, I'm hoping to avoid client-side scripting if at all possible. Oh well,
I will probably mangle the content that's forcing me to keep the table so
that I can wrap it in CSS or if all else fails do some more server side
sniffing and write out a table or CSS as appropriate.

Thanks again
Finn
Jul 20 '05 #3
Steve Pugh wrote:
I can't think of a pure CSS solution. You could use the DOM to
dynamically remove the table markup and replace it with divs.


Wow, I can strip markup based on stylesheet selection?
What do I read up on?

Jul 20 '05 #4
JustAnotherGuy <no******@sorry.com> wrote:
Steve Pugh wrote:
I can't think of a pure CSS solution. You could use the DOM to
dynamically remove the table markup and replace it with divs.


Wow, I can strip markup based on stylesheet selection?


Not simply.

CSS _can't_ strip markup.

JavaScript (or another scripting language, but let's assume JS for
now) can.

What triggers that JavaScript can vary widely.

Whether selecting an alternate (sic) stylesheet can be used as the
trigger is going to vary between browsers. I would expect it to be
possible in Mozilla but I doubt it's possible in Opera. Just guessing
off the top of my head.

IE, of course, doesn't support alternate stylesheets. So whatever
method you use to force the application of the "alternate" stylesheet
(either JS or a client side process) can also change your markup at
the same time.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #5
Steve Pugh wrote:

IE, of course, doesn't support alternate stylesheets. So whatever
method you use to force the application of the "alternate" stylesheet
(either JS or a client side process) can also change your markup at
the same time.

Steve


Yeah, thanks :) But I actually misphrased my question, I don't really
about the trigger being a stylesheet change. What client side process
can enable me to do that--select which tags (and the content inside
them) to remove then dynamically produce a page hence changed from its
original state? I was looking at XSLT but it doesn't seem to be what I'm
looking for.

Jul 20 '05 #6
JustAnotherGuy wrote:
Steve Pugh wrote:

IE, of course, doesn't support alternate stylesheets. So whatever
method you use to force the application of the "alternate" stylesheet
(either JS or a client side process) can also change your markup at
the same time.

Steve


Yeah, thanks :) But I actually misphrased my question, I don't really
about the trigger being a stylesheet change. What client side process
can enable me to do that--select which tags (and the content inside
them) to remove then dynamically produce a page hence changed from its
original state? I was looking at XSLT but it doesn't seem to be what I'm
looking for.

xposting to alt.html to try an NG for which this is more on-topic,
though not sure if I should be doing this or starting a new thread. Oh well.

I'm not sure where exactly would be on topic, but I'm looking for a
pointer (to a specific technology or process) more than anything else.

Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
0
by: Finn Newick | last post by:
By defining a style as follows: @media aural, handheld {td.layout {display:block;}} I'm hoping to linearise layout tables when viewed by screenreaders and handheld devices (it is also be in...
5
by: Harry | last post by:
CSS Description: Table contains a column of td cells with links. Achieved: 1. Entire link cells highlight when hovered. 2. The entire area of these cells are clickable. Problem:
3
by: Paul W | last post by:
Hi - I generate a table using code similar to the following (simplified), and this works fine for most browsers/platforms. For Safari on Mac, the table displays 'vertically collapsed' for rows...
5
by: shanti.miller | last post by:
I've got a grid that uses paging and displays a maximum of 10 records at a time. Sometimes the fields have a lot of data in them and the datagrid takes up way too much horizontal space. I've...
3
by: John Morgan | last post by:
I suppose the answer to this is staring me in the face but.... How do I programmatically get a page to post back? The actual situation is that I am using an aspx table control and changing the...
2
by: Dave Ekhaus | last post by:
hi i'm new to javascript. i'm hoping to get some help and find out if what i want to do is possible and - assuming it is, get some tips on how to accomplish the task. ok - assume i have a...
3
by: Harry | last post by:
Using IE7, I'm trying to display a table in a horizontal manner by floating the rows. The following html does not work, displaying the table vertically as if the rows were not floated. This same...
0
by: skoyala | last post by:
Hi All, I need to put a horizontal scroll bar for 4 cells alone where my first cell in table should not contain any horizontal scroll bar but i need to put vertical scroll bar to both first and 4...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.