I need to add a code snippet ... that will break the output of the multiple choice table into two, or preferably three columns.

You don't give any indication of acceptable formatting and I'm not inclined to plow through the wall of code to find the "output of the multiple choice table", but maybe something like this will serve. Examples are generated for many different numbers of items, but only a few are shown here.

c:\@Work\Perl\monks>perl -wMstrict -le "my @things = qw( zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen ); ;; use constant COLS => 3; use constant FMT => '%10s ' x COLS; ;; for my $max (0 .. $#things) { my @stuff = @things[0 .. $max]; my $k = @stuff / COLS; $k = int($k + 1) if int($k) != $k; ;; my @rows; $rows[$_ % $k][$_ / $k] = $stuff[$_] for 0 .. $#stuff; ;; for my $ar_row (@rows) { printf qq{${ \FMT }\n}, @$ar_row, ('') x COLS; } print '--------------'; } "
Output:
zero -------------- zero one -------------- zero one two -------------- zero two one three -------------- zero two four one three -------------- zero two four one three five -------------- zero three six one four two five -------------- ... ... -------------- zero six twelve one seven thirteen two eight fourteen three nine fifteen four ten five eleven -------------- zero six twelve one seven thirteen two eight fourteen three nine fifteen four ten sixteen five eleven -------------- zero six twelve one seven thirteen two eight fourteen three nine fifteen four ten sixteen five eleven seventeen --------------

... I can make a donation, but not a great one.

Yes, any donation, however small, is most welcome — and thank you in advance!


Give a man a fish:  <%-{-{-{-<


In reply to Re: Break HTML table output into two or three columns by AnomalousMonk
in thread Break HTML table output into two or three columns by Jagtig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.