In a view, in this case on a page display, page details set as table.
Content for fields is modified to include first name and last name in the last name field's REWRITE RESULTS.
[field_first_name] [field_last_name]
Style settings are thus:
Style Settings
[X]Customize field HTML
HTML element
[ SPAN ]
[X] Create a CSS class
CSS class
[ full-name-altered ]
You may use token substitutions from the
rewriting section in this classSet css to:
.full-name-altered {
font-size: 1.5em;
font-weight: bold;
}Expected to see this source code on render:
<td class="views-field views-field-field-last-name">
<span class="full-name-altered">LaWanda Jones</span>
</td>Got this source code on render:
<td class="views-field views-field-field-last-name full-name-altered">
<span>LaWanda Jones</span>
</td>
The only way I can get it do provide the expected source code is to uncheck 'Customize field HTML' and put the following in REWRITE RESULTS:
<span class="full-name-altered">[field_first_name] [field_last_name]</span>
I wouldn't have noticed it if I hadn't check the source. It renders the way I expect, but what's the point of the span if it's not used as the expected css wrapper? Is this not a bug?
Comments
Comment #1
dawehnerThat's actually intended in the table style plugin, sorry.
Remove senseless tags.
Comment #2
gr33nman commenteddawehner, thanks for your reply.
Just to be clear... Will this remain as-is, in essence meaning I've misunderstood how to use a 'feature' that is not a 'bug', or has it been fixed so that the behavior will give the views user the expected experience?
Comment #3
merlinofchaos commented"The expected" is a misleading phrase. That's your expectation, but that is not everybody's expectation.
Tables very specifically put the field class on the TD tag.
Because if the hierarchical nature of CSS, this shouldn't really be a problem, should it? In MOST use cases, the TD tag is where the class is wanted when using tables.
Comment #4
merlinofchaos commentedBTW what I mean about the CSS is this:
Comment #5
merlinofchaos commentedOh, and one addendum: If we didn't put the class on the TD tag, you wouldn't be able to add CSS to the TD at all. Whereas with this method, you can CSS either one however you like.