I haven't been able to look at the latest patch in #991454: Add element #type table (with tableselect and tabledrag support) but I promise to review it once I have the time, in case it hasn't gone in until then.

For now, here is a rather simple patch that adds the ability to retain attributes such as colspan for cells.
It definitely works, because I'm currently testing this with the 7.x-2.x branch of Clock module.

Files: 
CommentFileSizeAuthor
#8 cell_row_attributes.patch1.18 KBtstoeckler
Test request sent.
[ View ]
#7 cell_row_attributes.patch1.18 KBtstoeckler
Test request sent.
[ View ]
#3 cell_attributes.patch953 byteststoeckler
Test request sent.
[ View ]
#1 cell_attributes.patch953 byteststoeckler
Test request sent.
[ View ]

Comments

StatusFileSize
new953 bytes
Test request sent.
[ View ]

And the patch...

hm. That's definitely the simplest approach, but it duplicates the #attributes of the cell content markup, in case the cell's content is "simple"; i.e., $element[$first][$second] contains the cell content directly (no further sub-keys).

That might be acceptable, but perhaps not. It's definitely not acceptable when considering #attributes['id']...

An alternative approach would be to support a custom #wrapper_attributes or #cell_attributes property.

StatusFileSize
new953 bytes
Test request sent.
[ View ]

While #wrapper_attributes definitely sounds nice, I'd say let's go with a simple approach that works for this now.
Introducing #cell_attributes. I also went for #row_attributes for consistency. The risk of confusion/duplication isn't very big for rows, but I thought why not. I'll reroll without that, though, if you don't like it.

I tested the basic functionality and it works.

Just to make that clear, I think #wrapper_attributes is the right direction in the long run, I just don't know how to implement it in a generic fashion. Or of course, we could just call what I called #row_attributes and #cell_attributes #wrapper_attributes, I don't know. I'm not really 100% comfy with the Form/Render API so I'll basically roll whatever you say...

Status:Needs review» Needs work

Wow, I just realized I uploaded the same patch twice...
Don't know if I can still find the right one, otherwise I'll have to re-code. Anyway, needs work.

Assigned:Unassigned» tstoeckler

Also, assigning so that I don't forget.

Status:Needs work» Needs review
StatusFileSize
new1.18 KB
Test request sent.
[ View ]

Here we go.

StatusFileSize
new1.18 KB
Test request sent.
[ View ]

Retesting