Hi,

I know no-one replied to this message. But I just wanted to give an
update with some progress. It turns out that an Html Table is actually
best composed by joining up to 3 similar tables together.

* The table column headers, can be in itself a multi-row table (with
spanning elements).

* The table row headers, similarly is also representable as a multi-row table.

* The table data itself, is also.

So my table classes have become like this:


|--------------------------------|
|                |-------------| |
|                |             | |
|                |  column     | |
|                |  headers    | |
|                |             | |
|                |             | |
|                |-------------| |
| |-------------||-------------| |
| |             ||             | |
| |             ||             | |
| | row headers || table data  | |
| |             ||             | |
| |             ||             | |
| |-------------||-------------| |
|           table view           |
|--------------------------------|


Where the table View class is responsible for joining and rendering
the whole table in haml. And the 3 individual pieces of the table are
each an identical / reusable class.

So in ruby, we would construct the table something like this:

  @table_column_headers = Haml::Table.new
  @table_row_headers = Haml::Table.new
  @table_data = Haml::Table.new

  @table_view = Haml::TableView.new
  @table_view.column_headers = @table_column_headers
  @table_view.row_headers = @table_row_headers
  @table_view.data = @table_data


It seems possible to indicate spanning elements explicitly, eg:

["cell", "cell", :span, :span, "cell"]

However there are many other cell attributes also need representing
(eg CSS Class, id tag, etc). Im hoping to represent all these in a
uniform way throughout the table family of object.

On Mon, Apr 26, 2010 at 7:08 PM, dreamcat four <[email protected]> wrote:
> Hello,
>
> Have recently started using Haml, and writing my first html table. Its
> for a comparison grid, like these:
>
> http://www.smashingmagazine.com/2008/08/13/top-10-css-table-designs/
>
> http://www.edesignerz.net/webmaster-stuff/4526-25-clear-and-beautiful-comparison-tables
>
>
> At first it seemed tricky because depending upon the specific data and
> web page design, its pretty difficult to say beforehand whether the
> the columns and rows should be either down or across (portrait or
> landscape, whatever). So I decided it would be worth making a generic
> table helper / layout object. By default the rows are laid out to the
> rows, and the columns are put to the columns. We shall call that
> "Portrait mode". But a boolean "flip" accessor will transpose and swap
> around the rows <=> columns.
>
> If anyone else is interested in this table convenience class, it shall
> be made available. Another feature might be "spanning" columns. So
> thats all great. Im sure it'll be fun doing that.
>
> Anyway. It occured to me to ask if there were already such haml helper
> libraries out there? I am vaguely aware that there is something called
> "haml helpers", but are those the same thing?
>
>
> dreamcat4
> [email protected]
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to