How to theme a table around form elements?



Good morning,

Using D6 Core, and ideally no contrib modules, I need to theme a table around two sets of checkboxes, each set of checkboxes has the same number of checkboxes. The table should be built like:

col1: first checkbox from checkboxes1
col2: title of first checkbox from checkboxes1
col3: first checkbox from checkboxes2

.. and so on for each table row.

My current thinking is to create a custom element type for the table, and to make the two checkboxes form elements children of the table element. Within the theme function for the table I will then render the checkboxes and build an array of table rows to pass to theme_table().

Would love any thoughts / recommendations.

Thanks,
Everett