I want to style crosstab in such a way that the alternative column has different color.
Is it possible
Styling Cross Tab
(6 posts) (2 voices)-
-
By alternative column you mean the data columns? Yes, you can use CSS for this:
select 'dbr.css', 'td.ct_data:nth-child(even) {background: #EAEAEA}';
--
myDBR Team -
SELECT 'dbr.sum' , 'TYTotalWL'
select 'dbr.column.filter','TCODE','text';
select 'dbr.column.filter','TNAME','text';
select 'dbr.crosstab', '[MONTH]'
select 'dbr.css', 'td.ct_data:nth-child(even) {background: #EAEAEA}';
SELECT
TMD.[TCODE]
,Tests.TNAME
,TMD.[MONTH]
,TMD.[TYTotalWL]
FROM [LIMS_LIVE].[dbo].[TMIS_B_010_DIXIT] TMD
LEFT JOIN View_Clients VC ON VC.ClientCode = TMD.CLCODE
AND VC.OrgID = 67
LEFT JOIN View_Tests671 Tests ON Tests.TCODE = TMD.TCODE
AND Tests.OrgID = 67
WHERE CLCODE = @inClientCode
ORDER BY TMD.[TCODE]
,Tests.TNAME
,TMD.[MONTH]In this CrossTab I want the alternative columns to have different colors for field month
-
As the month is the cross tab column do you want to have different colors for the header or the data column TYTotalWL?
Does the "td.ct_data:nth-child(even)" rule make any difference? What is the browser you are using?
--
myDBR Team -
I am using latest firefox (31.0)
The command
select 'dbr.css', 'td.ct_data:nth-child(even) {background: #EAEAEA}';
has no imapct -
Hi,
yes, the ct_data class was used only when horizontal summaries was in use. Instead you can use:select 'dbr.css', 'td.cell:nth-child(2n+4) {background: #EAEAEA}';
Meaning: starting from fourth column, apply the style to every other column.
--
myDBR Team
Reply
You must log in to post.