2014-09-12 92 views
0

我使用的是jquery.jtable,我有一行正在調用jquery.jtable.js中的openChildTable方法。jquery jtable子表標題縮進

我想找到縮進子表標題的方法。下面是其創建表的代碼:我嘗試添加的樣式屬性和設置距左側向移動它

function getResponseChildTable(ContainerID) { 
    var table = { 
     title: '', 
     width: '5%', 
     sorting: false, 
     edit: false, 
     create: false, 
     display: function(data) { 
      //create an image to be used to open child table 
      var $img = $('<img src="' + config.base_url + 'assets/images/expand_row-small.png" title="View Responses" style="height:30px;width:30px;cursor:pointer;" height="30" width="30"/>'); 
      $img.click(function() { 
       $('#' + ContainerID).jtable('openChildTable', 
         $img.closest('tr'), 
         { 
          title: 'Response Plans', 
          actions: { 
           listAction: config.base_url + "data_fetch/responses/" + data.record.risk_id 
          }, 
          messages: defaultResponseMessages, 
          fields: getResponseFieldsSmall() 
         }, function(data) {//opened handler 
        data.childTable.jtable('load'); 
       }); 
      }); 
      //return image to show on row 
      return $img; 
     } 
    }; 
    return table; 
} 

,但沒有成功。也許我做錯了。所以所有的建議都表示讚賞我發佈了評論中的鏈接。

我是jquery.jtablejs的新手,請原諒我的錯誤。

+0

這裏是什麼樣子: http://imgur.com/OKkvl3x http://imgur.com/v4JaEN5這裏就是我想使它看起來像:http://imgur.com/lNpyfYI我通過Chrome Inspect Element添加了樣式邊距,從而達到了所需的效果。 – shhasan 2014-09-12 21:29:03

回答

0

我能夠解決使用CSS的問題。