WeBWorK Problems

ww2.9 and tables

Re: ww2.9 and tables

by Alex Jordan -
Number of replies: 0
The issues with unionTables.pl are my fault. I'll submit a fix later today if Davide hasn't beaten me to it.

If you are authoring new problems, consider using pccTables.pl instead. It is in the release candidate 2.9 branch of pg. I have not gotten around to writing documentation for the wiki for this, but the file itself has documentation about how to use it.

The main reason for using it is web accessibility. For visually disabled persons, true data tables should have all of the table structure: a caption and at least one of row headers and column headers. There is another type of "table" called a layout table where HTML tabling is used only for the arrangement of content on the screen. These types of "tables" should actually be built using div boxes to help visually disabled persons understand the important parts of what is on screen.

pccTables.pl provides DataTable() and LayoutTable() subroutines to handle the two different types.

Your table could be enacted with:

\{DataTable(
[[{data=>"X", header=>"CH"}, {data=>"Y", header=>"CH"}],
[1, 1],
[1, 1]],
allcellcss=>"border:1pt solid; padding:4pt",
caption=>"Data",
);\}

As a bonus, you can do more styling with these tables and css controls. If you wanted to get fancy, you can start doing things like:


\{DataTable(
[[{data=>"X", header=>"CH", rowcss=>"background-color:orange;"}, {data=>"Y", header=>"CH"}],
[1, 1],
[1, 1]],
allcellcss=>"border:1pt solid black; padding:4pt;",
datacss=>"color:blue;",
caption=>"Data",
);\}

There will be differences in the hard copy version from how unionTables.pl handles it. I hope to have more LaTeX packages loaded into hard copy production so that the hard copy tabling can be more robust, but this can be added retroactively.