WeBWorK Main Forum

Documentation for Tables in PGML

Re: Documentation for Tables in PGML

by Gustavo Felisberto-Valente -
Number of replies: 0
Thank you for all these suggestions. I think I am going to simplify the concept a little and place Gender on the header. So I don't need a "first column" only to output the second variable.
[@ 
DataTable(
[
[['Gender',header => 1],['Academic Major', colspan => 5,headerrow => 1]],
['','Business','Science','Liberal Arts','Other','Total'],
['Female',$data[0][0],$data[0][1],$data[0][2],$data[0][3],$data[0][0]+$data[0][1]+$data[0][2]+$data[0][3]],
['Male',$data[1][0],$data[1][1],$data[1][2],$data[1][3],$data[1][0]+$data[1][1]+$data[1][2]+$data[1][3]],
['Total',$data[0][0]+$data[1][0],$data[0][1]+$data[1][1],$data[0][2]+$data[1][2],$data[0][3]+$data[1][3],$total],
],
tablecss => 'border: 1px solid black;',
midrules => 1,
align => '| c | c | c | c | c | c | c |',
);
@]*

Please ignore the "data[i][j]" there, they are part of a randomization process I defined in the preamble. The only changes I made were: removed the first column, wrote Gender in the first cell (as a header)