Styling Cross Tab

(6 posts) (2 voices)

Tags:

No tags yet.

  1. ajitdixit, Member

    I want to style crosstab in such a way that the alternative column has different color.
    Is it possible

  2. myDBR Team, Key Master

    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

  3. ajitdixit, Member

    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

  4. myDBR Team, Key Master

    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

  5. ajitdixit, Member

    I am using latest firefox (31.0)
    The command
    select 'dbr.css', 'td.ct_data:nth-child(even) {background: #EAEAEA}';
    has no imapct

  6. myDBR Team, Key Master

    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.