#1 (permalink)  
Old 03-10-2007, 09:21 AM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,437
Accessible, Proper Multi-Level Tabular Data

I'm having some trouble with a table I'm creating. Obviously, I can get it laid out just fine using just tr and td tags, but that doesn't meet the accessibility standards. So, I'm trying to figure out how to do this accessibly.

Here's my problem:

I have a table that is basically two levels deep. The second level has four subsets within it.

What it is, is a table detailing the course requirements for a four semester program. Therefore, we will have a dataset for each of the four semesters, but they all should logically go in one table, as they all deal with the same program. I then have a footer at the bottom of each dataset totaling the number of credits for each semester. At the bottom of the table, I have a footer totaling the number of credits for the entire program.

The way I understand it, you are supposed to label your th elements (actually, identify them with the "id" switch), and then refer to them with the "headers" switch in each of your data cells. Each of my datasets should have a header identifying in which semester those courses belong. Also, each of my four datasets should have the identifiers showing that column 1 is the course number, column 2 is the course name, and column 3 is the number of credits for that course. So each of my four headers needs to go at the top of my table. I think that would look something like:
Code:
	<tr>
		<th id="sem1" colspan="3">First Semester</th>
	</tr>
	<tr>
		<th id="sem2" colspan="3">Second Semester</th>
	</tr>
	<tr>
		<th id="sem3" colspan="3">Third Semester</th>
	</tr>
	<tr>
		<th id="sem4" colspan="3">Fourth Semester</th>
	</tr>
	<tr>
		<th id="coursenum">Course #</th>
		<th id="coursename">Course Name</th>
		<th id="coursecredits">Credits</th>
	</tr>
Then, I need to have a footer for each of my datasets, as well as a footer for the whole table. This is where I really get tripped up. I can't seem to figure out how to identify which set of rows goes with each footer. According the W3C and section 508 of the accessibility guidelines (at least, the way I understand it), table footers are supposed to be coded and identified at the top of the table. I think that would look something like:

Code:
	<tfoot id="sem1footer">
		<tr>
			<td colspan="2" style="text-align: right;">Total</td>
			<td>16</td>
		</tr>
	</tfoot>
	<tfoot id="sem2footer">
		<tr>
			<td colspan="2" style="text-align: right">Total</td>
			<td>18</td>
		</tr>
	</tfoot>
	<tfoot id="sem3footer">
		<tr>
			<td colspan="2" style="text-align: right">Total</td>
			<td>16</td>
		</tr>
	</tfoot>
	<tfoot id="sem4footer">
		<tr>
			<td colspan="2" style="text-align: right">Total</td>
			<td>14</td>
		</tr>
	</tfoot>
	<tfoot id="programtotal">
		<tr>
			<td colspan="2" style="text-align: right;">Total</td>
			<td>64</td>
		</tr>
	</tfoot>
Then, I'm supposed to present my data. I think, if I am understanding correctly, that should look something like (a very small snippet of the information):
Code:
	<tbody id="sem1body">
		<tr>
			<td headers="sem1 coursenum">
				ITD 115
			</td>
			<td headers="sem1 coursename">
				Web Design Principles
			</td>
			<td headers="sem1 coursecredits">
				3
			</td>
		</tr>
		<tr>
			<td headers="sem1 coursenum">
				ITD 116
			</td>
			<td headers="sem1 coursename">
				PHP Programming
			</td>
			<td headers="sem1 coursecredits">
				3
			</td>
		</tr>
	</tbody>
	<tbody id="sem2body">
		<tr>
			<td headers="sem2 coursenum">
				ITD 117
			</td>
			<td headers="sem2 coursename">
				Perl Programming
			</td>
			<td headers="sem2 coursecredits">
				3
			</td>
		</tr>
	</tbody>
	<tbody id="sem3body">
		<tr>
			<td headers="sem3 coursenum">
				ITD 118
			</td>
			<td headers="sem3 coursename">
				Javascript
			</td>
			<td headers="sem3 coursecredits">
				3
			</td>
		</tr>
	</tbody>
	<tbody id="sem4body">
		<tr>
			<td headers="sem4 coursenum">
				ITD 119
			</td>
			<td headers="sem4 coursename">
				Macromedia Flash
			</td>
			<td headers="sem4 coursecredits">
				3
			</td>
		</tr>
	</tbody>
My problem is, I can't figure out how to get the headers and footers associated with the right set of information. I have tried using the "headers" tag to associate the right headers with each cell, but that doesn't seem to be working out for me.

The table, ideally, should look something like the attached image called "tableright.png" (with more formatting, etc.). Unfortunately, it currently looks like the attached image called "tablewrong.png".
Attached Images
File Type: png tableright.png (6.9 KB, 130 views)
File Type: png tablewrong.png (5.8 KB, 127 views)
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote

  #2 (permalink)  
Old 03-12-2007, 08:37 PM
Registered User
 
Join Date: Jun 2004
Location: Ann Arbor, MI, USA
Posts: 73
Send a message via ICQ to \Kritikal\ Send a message via AIM to \Kritikal\
Here's a link to the code I cooked up. It's totally semantic but I think that's part of the problem, being too semantic, it certainly doesn't help with formatting.

The nitty gritty of what you need is a dataset within a dataset and this is what my code is, a table within a table.

Just use CSS to format to get it to look nice.

http://kritikal.dyndns.org/temp/table.html
__________________
-\Kritikal\-
Reply With Quote
  #3 (permalink)  
Old 03-12-2007, 10:00 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,437
That's good. I don't know why I didn't think of that. I should be able to make that work without much trouble at all.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clueless-user-friendly Table Data obloquy Programming and Scripting 1 12-25-2005 08:43 AM
Suckerfish Dropdown Menus Moxy_Fruvous Programming and Scripting 3 05-18-2005 02:23 PM


All times are GMT -5. The time now is 07:15 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter