#!/usr/bin/perl ############################################################ # &outputDebug(); # uncomment this to enable debug mode output # On the web, see http://www.bath.ac.uk/%7Epy8ieh/cgi/development/tests/tables ############################################################ # name: Tables # author: Ian Hickson # license: GPL # description: serious stress tests for table layout # This test is at: # http://www.bath.ac.uk/%7Epy8ieh/cgi/development/tests/tables ############################################################ # Initialise System use lib '../utils'; use strict 'vars'; $output::mediaPath = '../../../media/'; $output::appName = 'Table Stress Tests'; $output::appStyle = 'style/table-test.css'; $output::authorContact = 'http://www.bath.ac.uk/%7Epy8ieh/'; $output::authorName = 'Ian Hickson'; $output::authorEmail = 'py8ieh=website=cgi=development=tests=tables@bath.ac.uk'; require 'inputRoutines.pl'; # get cookies, parameters require 'outputRoutines.pl'; # so that we can output stuff ############################################################ $param::tables = 1 unless defined($param::tables); $param::heads = 0 unless defined($param::heads); $param::foots = 0 unless defined($param::foots); $param::bodies = 1 unless defined($param::bodies); $param::rows = 5 unless defined($param::rows); $param::cols = 5 unless defined($param::cols); $param::delay = 0 unless defined($param::delay); $param::junk = 6 unless defined($param::junk); $param::confusion = 0 unless defined($param::confusion); $param::tablestyle = 'table-layout: fixed; width: 80%;' unless defined($param::tablestyle); &output::printHTMLHeader(); print '
Version 2.2! Now with Extra Confusion Parameter!
'; print "$param::tables test table".($param::tables == 1 ? '' : 's')." × ($param::rows row".($param::rows == 1 ? '' : 's')." × $param::cols cell".($param::cols == 1 ? '' : 's').") × ($param::heads header".($param::heads == 1 ? '' : 's')." + $param::bodies bod".($param::bodies == 1 ? 'y' : 'ies')." + $param::foots footer".($param::foots == 1 ? '' : 's').") = $total cell".($total == 1 ? '' : 's')." total".(($param::delay > 0) ? (" (plus ".($total * $param::delay)." second".(($total * $param::delay) == 1 ? '' : 's')." delay minimum)") : "") .($param::confusion > 0 ? ", excluding any extra confusion cell" : "").".
"; my ($t, $x, $y); my ($cells) = $param::confusion; for ($t = 1; $t <= $param::tables; $t++) { print "