CSS Selectors for table headings from the Jira issues macro

Comments

8 comments

  • Avatar
    Guy Eden

    So I managed to find the xhtml file on the fielsystem, relevant extract below - still nothing applied to the relevant selectors seems to work!

    <p>
    </p> <div class="tablewrap">
    <table class="aui"><thead class=""><tr><td colspan="1" rowspan="1" class="jira-macro-table-underline-pdfexport jira-tablesorter-header">

    <p>Key
    </p> </td><td colspan="1" rowspan="1" class="jira-macro-table-underline-pdfexport jira-tablesorter-header">

    <p>Summary
    </p> </td><td colspan="1" rowspan="1" class="jira-macro-table-underline-pdfexport jira-tablesorter-header">

    <p>Description
    </p> </td><td colspan="1" rowspan="1" class="jira-macro-table-underline-pdfexport jira-tablesorter-header">

    <p>marketing notes
    </p> </td><td colspan="1" rowspan="1" class="jira-macro-table-underline-pdfexport jira-tablesorter-header">

    <p>marketing priority
    </p> </td><td colspan="1" rowspan="1" class="jira-macro-table-underline-pdfexport jira-tablesorter-header">

    <p>Status

     

    0
    Comment actions Permalink
  • Avatar
    Nils Bier

    Hi Guy,

    thanks for contacting us. Did you already had a look at the following page in our documentation: https://www.k15t.com/display/PDF/How+Can+I+Deal+with+Wide+Tables

    Does any of the mentioned tweaks help?

    Cheers,
    Nils

    0
    Comment actions Permalink
  • Avatar
    Guy Eden

    Hi Nils,

    Yes, we already do a lot of these and have standard templates for users who need big tables.  

    The strange thing here is that there is no problem styling all the cell contents outside of the header; specifically the header rows seem to refuse to take any styling, and cause the columns to be much too wide.  

    I attach a screenshot of an example: you can see that the cell contents are restricted in width (styled with max-width), but the headers remain problematic.

    Any ideas welcome!




    PDF_export_of_jira_macro_problem.png
    0
    Comment actions Permalink
  • Avatar
    Nils Bier

    Hi Guy,

    thanks for the further details. Does the described behavior only occur when using the JIRA Issues Macro, or do you have this problem with every table?

    Cheers,Nils

    0
    Comment actions Permalink
  • Avatar
    Guy Eden

    Hi Nils,

    Only the JIRA issues macro, and specifically only the table header.

    0
    Comment actions Permalink
  • Avatar
    Guy Eden

    Another update: 

    I tried doing:

    td.jira-macro-table-underline-pdfexport * {
    width:5cm !important;
    }

    This works, causing all the columns including the headers to be fixed at 5cm.  This is a possible workaround, but not a great one.

    Doing the same thing using max-width instead of width does not work.

    0
    Comment actions Permalink
  • Avatar
    Guy Eden

    Is there any way I can use metadata (from the metadata macro) in the stylesheet for the PDF export?

    Until I work out how to apply max-width and not just width, I would like users to be able to set the width of their tables from the page, based on the fields they are retrieveing from Jira.

    So I would like to put something like

    td.jira-macro-table-underline-pdfexport * {
    width: $metadata.from("PDFColumnWidth")cm !important;
    }

    in the PDF export stylesheet, where PDFColumnWidth is defined in the metadata macro on the page being exported.  I tried it naively and it doesn't work . . .

    0
    Comment actions Permalink
  • Avatar
    Guy Eden

    In case this is useful for anybody,note that the following also works to achieve appropriately sized columns (although not at all user friendly, hence the question above re: doing this as some sort of metadata):

    td:nth-child(1).jira-macro-table-underline-pdfexport * {

    width: 1cm !important;
    }

    td:nth-child(2).jira-macro-table-underline-pdfexport * {
    width: 3cm !important;
    }

    td:nth-child(3).jira-macro-table-underline-pdfexport * {
    width: 7cm !important;
    }

    td:nth-child(4).jira-macro-table-underline-pdfexport * {
    width: 3cm !important;
    }

     

    etc.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk