Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Span Column Header II

I have a grid question using a 11-point scale in the columns, and I'd like to have "Not at likely" to the left above  0 - 2 and to the far right above 8 - 10 Extremely likely.

I tried to modify the script above with:


 <style>
#leftColumnLabel {
   padding-left: 365px;
}
</style>

 

 <script>
$(document).ready(function(){
    var html = '<tr> <td id = "leftColumnLabel" colspan="3" >Not at all likely</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>';
    $('#[% QuestionName() %]_div .inner_table > tbody').prepend(html);
    $('#[% QuestionName() %]_div .inner_table > tbody > tr:odd > td').removeClass('alt_color1').addClass('alt_color2');
    $('#[% QuestionName() %]_div .inner_table > tbody > tr:even > td').removeClass('alt_color2').addClass('alt_color1');
})
</script>



but it is not looking good.
related to an answer for: Span Column Header
asked Oct 20 by anonymous
Your CSS is apply a fairly massive bit of padding to the left of your "Not at all likely" text, which will likely make the contents of that cell look a bit cramped to the right.  Perhaps we need to remove or modify that CSS.  Can you expound on what you were hoping to achieve with it?  Do you want the text of this cell to be right-aligned?

Just to make sure, when you talk about this text appearing above column 0, do you mean the column of row labels?  Among the twelve total columns (row labels + 11 data columns), where should these two pieces of text appear?
Thank you for your reply.

The column list members are currently defined as
Not at all likely </br> 0
1
2
3
4
.
.
.
8
9
Extremely likely </br> 10


What I would like the grid table to look like is

                          Not at all likely                                       Extremely likely
                           0        1         2       3       4    ........            8        9       10  

Row item 1
Row item 2
Row item 3

Thank you

1 Answer

0 votes
You can replaced what you have and just add this to your footer to accomplish that.

[code]
<script type="text/javascript">
$(document).ready(function()
{
 row_html = "<tr><td class='corner_label_cell  alt_color1' align='left' colspan='1'>&nbsp;</td><td class='corner_label_cell  alt_color1' align='left' colspan='3'>Not at all likely</td><td class='corner_label_cell  alt_color1' align='center' colspan='5'>&nbsp;</td><td class='corner_label_cell  alt_color1' align='right' valign='bottom' colspan='3'>Extremely likely</td></tr>";
 $(".column_header_row").before(row_html);
});
</script>
[\code]
answered Oct 21 by Jay Rutherford Gold (38,025 points)
Thanks Jay

This is exactly would I want!  Much appreciated
Great!  Glad to hear that sorted out what you were looking for.  
You can easily adjust the text and formatting of the text within that script as well.  It is also setup with  a tag for a middle label as well (currently just set with a non-breaking space), which I sometimes have to use.
...