We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Vertical alignment of items in Columns

GerbenRienkGerbenRienk Posts: 810 ✭✭✭
Hi All,

It occurred to me that you can use the “trick” of going to the parent of the parent etc. to get to the HTML-tables that hold the CRF-items. That way you can align the items when you are using the Column option, for example when you’re scoring left-eye, right-eye.
What you do is you put

jQuery(document).ready(function($) {
function styleColumns(pClassSelector) {
$(pClassSelector).parent().parent().parent().parent().parent().css({'width':'50%'});
$(pClassSelector).parent().parent().parent().parent().parent().parent().parent().parent().css({'width':'100%'});
}
styleColumns('.twocolumns');
});


In the instructions of your section. Then you put in the Right_item_text of the items in columns 1 and 2 and of you go.

I’m sure most of you know enough to start experimenting with the above. For the rest I’ve made
http://www.trialdatasolutions.com/tds/howto/twocolumns.jsp
with lots of colors and pictures and an example CRF.
Happy layouting,

Gerben Rienk

Comments

  • adridderadridder Posts: 38
    Hi Gerben,
    Great, finally some proper aligning when you want to use multipe columns.
    Out of curiosity, is the
    $(pClassSelector).parent().parent().parent().parent().parent().css({'width':'50%'});
    line necessary? I tried your form without it, and it still seemed to do the trick.
    I think your first parent() statement leads to a td and your second one leads to a table tag? It might be a nice feature request to ask them to give these two a specific class in OC. That way we could skip having to add all the span tags and we could still get the nice layout if desired. But perhaps it's complicated...
    Cheers,
    Sander
    On 18 February 2013 21:22, Gerben Rienk wrote:
    Hi All,

    It occurred to me that you can use the “trick” of going to the parent of the parent etc. to get to the HTML-tables that hold the CRF-items. That way you can align the items when you are using the Column option, for example when you’re scoring left-eye, right-eye.
    What you do is you put

    jQuery(document).ready(function($) {
    function styleColumns(pClassSelector) {
    $(pClassSelector).parent().parent().parent().parent().parent().css({'width':'50%'});
    $(pClassSelector).parent().parent().parent().parent().parent().parent().parent().parent().css({'width':'100%'});
    }
    styleColumns('.twocolumns');
    });


    In the instructions of your section. Then you put in the Right_item_text of the items in columns 1 and 2 and of you go.

    I’m sure most of you know enough to start experimenting with the above. For the rest I’ve made
    http://www.trialdatasolutions.com/tds/howto/twocolumns.jsp
    with lots of colors and pictures and an example CRF.
    Happy layouting,

    Gerben Rienk
  • dualdual Posts: 16
    Hi all,
    I have an old study and I need to import the CRFs and the data from the current study.
    Could you assist me with this?
    Thank you
    Moha
  • GerbenRienkGerbenRienk Posts: 810 ✭✭✭
    Hi Sander,

    Great! The less lines the better.
    I just worked my way to this solution because I thought that this was what was needed, but apparently it is not necessary.
    Many thanks,

    Gerben Rienk
    Van: [email protected] [mailto:[email protected]] Namens Sander de Ridder
    Verzonden: woensdag 20 februari 2013 8:44
    Aan: [email protected]
    Onderwerp: Re: [Users] Vertical alignment of items in Columns

    Hi Gerben,
    Great, finally some proper aligning when you want to use multipe columns.
    Out of curiosity, is the

    $(pClassSelector).parent().parent().parent().parent().parent().css({'width':'50%'});
    line necessary? I tried your form without it, and it still seemed to do the trick.
    I think your first parent() statement leads to a td and your second one leads to a table tag? It might be a nice feature request to ask them to give these two a specific class in OC. That way we could skip having to add all the span tags and we could still get the nice layout if desired. But perhaps it's complicated...

    Cheers,
    Sander

    On 18 February 2013 21:22, Gerben Rienk wrote:
    Hi All,

    It occurred to me that you can use the “trick” of going to the parent of the parent etc. to get to the HTML-tables that hold the CRF-items. That way you can align the items when you are using the Column option, for example when you’re scoring left-eye, right-eye.
    What you do is you put


    jQuery(document).ready(function($) {

    function styleColumns(pClassSelector) {

    $(pClassSelector).parent().parent().parent().parent().parent().css({'width':'50%'});
    $(pClassSelector).parent().parent().parent().parent().parent().parent().parent().parent().css({'width':'100%'});
    }
    styleColumns('.twocolumns');
    });



    In the instructions of your section. Then you put in the Right_item_text of the items in columns 1 and 2 and of you go.

    I’m sure most of you know enough to start experimenting with the above. For the rest I’ve made
    http://www.trialdatasolutions.com/tds/howto/twocolumns.jsp
    with lots of colors and pictures and an example CRF.
    Happy layouting,

    Gerben Rienk
This discussion has been closed.