Closed (fixed)
Project:
Table Alternate Rows
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jul 2011 at 18:31 UTC
Updated:
27 Feb 2024 at 07:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alphasupremicus commentedI have a table where the first cell in the first row has the class "rteright" (put there by ckeditor when I right-aligned the cell) and, if that's the case, then this filter just avoids adding the odd or even class to the row. Basically, I can't seem to put any class on the first cell of any row it this filter doesn't format that row. Is this expected?
Again, I am only using the CKeditor which places a right alight class on the cell so I can format up the table. If I place right align classes on the second cell, then the row is still stripped properly with odd/even classes. Seems odd to me that this is a "first-cell in the row" only problem that causes this.
Comment #2
alphasupremicus commentedAttached is a simple patch that removes the check for class and just goes ahead and applies the even/odd closs to the TR element. I think the intent of the author was not to blow over the class of the TR row and just disregard applying the even/odd classes if the TR row had a class="something" already, but it turns out that the code is instead finding the class setting of my TD (cell) and is also skipping the entire row if my TD has a class.
There must be a better way to solve this - for now I just provide a patch that stops checking for "class=" and this fixes it for my site.
Comment #3
pheraph commentedSame here. Your patch may be a temporary fix but it would be nice if the module handled additional classes.
Comment #4
alphasupremicus commentedUnderstood. I didn't have time to add new features. I just wrote a patch to make this module behave consistently. I thought it was odd that there was a check for the first cell only in each row. If the first cell had a class then it punted and didn't apply the odd/even style. But the module didn't care if there were classes applied to the second, third, ... n cells in the row. So I find that inconsistency to be a bug myself.
John
Comment #5
Anonymous (not verified) commentedThis patch is slightly better in that it only checks for the 'class' attribute within the TR tag - it ignores classes in other tags (e.g. TD).
Unfortunately my regex is not strong enough to work out how to append classes instead of overwriting them...
Comment #6
xaa commentedhi, thank you for the patch. seems working as expected.
Will be great if it can be commit soon.
regs, xavier
Comment #7
samvel commentedHi Guys,
appended patch, now other classes in
Please review, thank you.
Comment #8
samvel commentedUp!
Comment #9
runnergirl commentedI tried the patch suggested by Samvel (comment #7) and it worked for me. In my case, I have two tables, in which only the second table was displaying with the odd/even row classes. After applying the patch, the first table then displayed as it should. Thank you Samvel for posting this patch.
Comment #10
johnpitcairn commentedThis patch works for me on a page with multiple tables that have class and data attributes on the table elements set by another filter. Without the patch, the odd/even row classes are not set.
I didn't test that existing row classes are preserved however.
Comment #11
johnpitcairn commentedI can confirm that existing row classes are preserved. Marking RTBC.
Comment #13
deviantintegral commentedThanks, I've committed #7.
Comment #14
astonvictor commentedSince the patch was merged, I guess we can close the issue.
Comment #15
astonvictor commented