Home › Forums › vLooup for SharePoint › Alternating row style and pring
Tagged: Alternate Rows, CSS, print, vlookup
- This topic has 5 replies, 3 voices, and was last updated 5 years, 10 months ago by Phil Grant.
-
AuthorPosts
-
-
January 2, 2019 at 11:14 #23305
Hi Alex,
I want to print rows from the vLookup Table in alternating style. It works to show the rows in alternating style with jQuery in the form itself, but when I want to print the tab, the style is not printed out with.
Do you have a suggestion on how to set the css for the vLookup to alternating by default ? Maybe the dynamic setting with jQuery is the problem here.
Thank you very much in advance,
BR,
Chris -
January 3, 2019 at 20:08 #23325
Hi,
You should be able to color alternating rows by adding this to the Custom CSS:.vLookupTableRow:nth-child(even){ background-color:#eaeaea; }
I’m working on an improved print functionality for the tabs so you might want to take a look at it and combine it with the above CSS snippet: https://spjsblog.com/forums/topic/page-breaks-when-printing-form/#post-23315
Please note that its only tested in Google Chrome and I’m working on getting it running in other browsers.
Alexander
-
January 25, 2019 at 09:47 #23646
Just to let you know that with IE and sharepoint 2010 this CSS doesn’t seem to work for me.
I’m not looking at printing though, I just want alternate colours in the display form.
Regards,
Phil- This reply was modified 5 years, 11 months ago by Phil Grant.
-
January 26, 2019 at 09:37 #23650
The :nth-child selector does not work in IE 8 (SP 2010 forces IE11 into IE8 mode). You can add this to your Custom JS to fix it (change vLookupTasks to match your vLookup column InternalName):
function vLookupIsLoadedCallback(fin){ if(fin === "vLookupTasks"){ jQuery(".vLookupTableRow:even").css("background-color","#eaeaea"); } }
Alexander
-
January 28, 2019 at 09:23 #23666
Thanks it worked a treat.
We were supposed to got to Sharepoint 2016 last August but it keeps getting delayed, hopefully now next month ….. I won’t hold my breath.
Cheers,
Phil
-
-
January 7, 2019 at 09:03 #23357
Hi Alexander,
Thank you very much, that worked like a charm.
BR,
Chris
-
-
AuthorPosts
- You must be logged in to reply to this topic.