0

i have a handsontable like below

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>

i can access

<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>

But i failed to access

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

How to do this...? What is the strucure of handsontable like

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

Tell me the correct structure of handsontable....

user1912935
  • 361
  • 4
  • 13
  • 34

2 Answers2

0

Nomenclature

  • Indentation indicates closure (so I don't have to clutter the outline with closing tags)
  • Splats (...) indicate repetition ad infinitum at the indicated level
  • Dot-Suffix indicates handsontable-applied class names

Schematic (v 0.8.3)

table
  colgroup
    col
  thead
    tr
      th
        div.relative
          span.colHeader
      th...
  tbody
    tr
      td...
DrFriedParts
  • 469
  • 10
  • 18
0

Try change:

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

For this:

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

First child of tr is th if you have set rowHeaders

edit: Also... Why have you use:

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

instead of :

${"#example1"} table th:last-child{display:none;}--last column Header
Setthase
  • 13,988
  • 2
  • 27
  • 30