Constructing / rendering a complex

Tue, 02 Aug 2011 13:35:32 -0700

Hi all,

I'd like to pick your brainz about how would you approach constructing
and rendering a complex table with headers, row/colspanning cells in a
most clean way that rids the view of rendering as much as possible.

Here's roughly what I'm after (incomplete, but you should see what I
mean):
http://imageshack.us/f/845/zrzutekranuqv.png/

There are three approaches I can think of:

     1. Construct a complete grid in the view, along with row/colspans
        that I would simply iterate over and render in the template, but
        that would make it virtually impossible to change the
        appearance.
     2. Count the cells / rows and compare them with data from the view
        to decide on how that particular cell should behave, but that
        makes the template a nightmare.
     3. ID all the cells and change the attributes accordingly, but for
        rowspanning cells I wouldn't know in the consecutive rows that
        there in fact was a cell and I might want to repeat it. Maybe I
        could fill in the complete grid but make the ones that get
        spanned ignorable in the template through a class.

I'll take all thoughts :)
-- 
Michał (Saviq) Sawicz <mic...@sawicz.net>

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to