The Add Table widget includes an instruction that the first row will be used as a header row and you should leave it blank if you don't want a header row. But the row striping makes it look like an ordinary row. The first row of fields should be highlighted in a way that distinguishes it from the data rows, ideally matching how it will display once it's saved.

Screenshot showing Add Table widget with alternate row striping.

Comments

cboyden’s picture

Issue summary: View changes
cboyden’s picture

Component: Widgets » Magic
Assigned: Unassigned » cboyden
Status: Active » Needs review
StatusFileSize
new416 bytes

The attached patch changes the style of the first row in the table widget to match the style of the TH as rendered by the default Panopoly theme. You could also change the top row to be actual TH cells, so they would use the styling in whichever theme was applied on the public pages, but that might have unintended consequences for table navigation. And it would require a patch to tablefield or overriding that in Panopoly.

dsnopek’s picture

Status: Needs review » Needs work
StatusFileSize
new10.29 KB
new3.27 KB

I just tried on a Panopoly site from the latest Git, and it is producing TH cells for the header row which look correct even without this patch!

Looking at the code, it's using the standard Drupal 'table' theme function, which does this by default (unless overridden). For me, the header row even shows up looking correct in the preview:

Are you maybe using a different theme or including some other module that overrides the 'table' theme function?

cboyden’s picture

StatusFileSize
new291.26 KB

I'm not talking about the Preview, which correctly outputs the top row as TH. I'm talking about the background striping of the data entry fields.
Screenshot of table widget, including source code

dsnopek’s picture

Oooh, sorry, I totally misunderstood. :-) I'll review this again when I have a chance!

dsnopek’s picture

Status: Needs work » Needs review
mglaman’s picture

Status: Needs review » Reviewed & tested by the community

Tested, applied clean. I dig, it makes the field's first row match the preview's header color.

dsnopek’s picture

Component: Magic » Widgets
Status: Reviewed & tested by the community » Needs work

I like the result - it looks super nice! :-)

However, this should be in panopoly_widgets, rather than panopoly_magic since it's panopoly_widgets that adds tablefield and uses it.

cboyden’s picture

Status: Needs work » Needs review
StatusFileSize
new407 bytes

Here's a patch that applies the CSS change to panopoly_widgets instead.

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

New patch works in Widgets!

  • dsnopek committed e21c935 on 7.x-1.x
    Update Panopoly Widgets for #2293293 by cboyden: Added highlighting to...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to @cboyden, for the patch and to @mglaman, for all the testing! New patch looks great - committed. :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.