jquery
  • html
  • css
  • handsontable
  • 2013-01-23 50 views 0 likes 
    0

    獲得TD我有像下面如何handsontable

    var $container = $("#example1"); 
    $container.handsontable({ 
        //data: data1, 
        rowHeaders:true, 
        colHeaders: ["<input type='checkbox' name='selectall' class='headchecker' checked='checked'>", "Com", "Form", "Size", "Grade", "Brand", "Fineness", "Serial", "Gross", "Net", "Fine Oz", "Original Weight","selectall"], 
        cols:13, 
        minSpareRows: 100 
    
    }); 
    
    <div id="example1" class="dataTable" style="width: 1170px; height: 450px; overflow: scroll;"></div> 
    

    我可以訪問

    <style> 
        ${"#example1"} table th{font-size:90%; font-weight:bold;}--Column Header 
        ${"#example1"} table th:first-child{text-align:left;width:20px;}--rowHeader 
        ${"#example1"} table th:first-child+th{width:3%;text-align:left;}--first column header 
        ${"#example1"} table th:first-child+th+th+th+th+th+th+th+th+th+th+th+th+th{display:none;}--last column Header 
        ${"#example1"} table tr:first-child{font-weight:bold;}--first row 
    </style> 
    

    一個handsontable但我失敗了訪問

    ${"#example1"} table tr td:first-child{font-weight:bold;}--first column 
    

    如何做到這一點.. 。? 什麼是handsontable像

    <table><thead><th><td></td></th></thead><tbody><tr><td></td></tr></tbody> 
    

    的strucure告訴我handsontable的正確結構....

    回答

    0

    命名

    • 縮進表示關閉(所以我沒有給弄亂帶結束標籤的輪廓)
    • Splats(...)指示在指定級別的無限重複
    • 點後綴表示小號handsontable -applied類名

    示意圖(V 0.8.3)

    table 
        colgroup 
        col 
        thead 
        tr 
         th 
         div.relative 
          span.colHeader 
         th... 
        tbody 
        tr 
         td... 
    
    0

    嘗試改變:

    ${"#example1"} table tr td:first-child{font-weight:bold;}--first column 
    

    對於這一點:

    ${"#example1"} table tr td:first-of-type{font-weight:bold;}--first column 
    

    tr第一個孩子如果您設置了行,則爲th

    編輯: 也...爲什麼你使用:的

    ${"#example1"} table th:first-child+th+th+th+th+th+th+th+th+th+th+th+th+th{display:none;}--last column Header 
    

    代替:

    ${"#example1"} table th:last-child{display:none;}--last column Header 
    
    相關問題