title: Building a mulit-dynamic HTML-Table with Wicket
body: <p>I have a very strange dynamic table that represents a daily shopping cart. The table lists a variable amount of options for each day. Each day can have 0 or even n options. The user, can add any of this n options to his selections. So the options part and also  the selections part can grow dynamically. </p>
  
  <pre><code>+-------+-------+-------+-------+-------+-------+-------+-------+---
  |  THE  | OPTIONS                       | SELECTIONS                  ...
  |  DAY  +-------+-------+-------+-------+-------+-------+-------+---
  |       | OPT 1 | OPT 2 | OPT3  | OPT n | 1.SEL | 2.SEL | 3.SEL |     ...
  +=======+=======+=======+=======+=======+=======+=======+=======+===
  | day 1 | opt 1 | opt 2 |       |       | opt 2 | opt 1 | opt 1 |     ...
  +-------+-------+-------+-------+-------+-------+-------+-------+---
  | day 2 | opt 1 | opt 2 | opt 3 | opt n | opt n |       |       |     ...
  +-------+-------+-------+-------+-------+-------+-------+-------+---
  | day 3 | opt 1 | opt 2 |       |       | opt 1 |       |       |     ...
  +-------+-------+-------+-------+-------+-------+-------+-------+---
  | day 4 |       |       |       |       |       |       |       |     ...
  +-------+-------+-------+-------+-------+-------+-------+-------+---
  | day 5 | opt 1 | opt 2 |       |       | opt 2 |       |       |     ...
  +-------+-------+-------+-------+-------+-------+-------+-------+---
  | day 6 | opt 1 |             ...
  +-------+-------+---
  | day 7 |               ...
  +-------+---
  |                 ...
  +---
  </code></pre>
  
  <p>Now I want to write code, that can generate a dynamic table, that considers the variable amount of days, options and selections. The tricky part is to dynamically add empty cells to the options columns as well as to the selection columns so that all cells have the right alignment to their corresponding table part.</p>
  
  <p>I always found some examples, but all suffer from calculation the right amount of option-cells to align the user selections.</p>
  
  <p>Do you have any suggestions how to build such a table? Or do you have any further considerations?</p>