protobi/js-xlsx

xlsx-style cell merged areas border

mithilesh786822 opened this issue · 4 comments

Merged cell border not working with json

Could you please leave some code snippet?

From the code above the first thing that I notice is the object structure. Haven't tried the object structure you provided above myself.
If this (picture attached) is what you want then the following object structure might be helpful.

workbook = {
  "SheetNames": [
    "Main"
  ],
  "Sheets": {
    "Main": {
      "!merges": [
        {
          "s": {
            "c": 0,
            "r": 0
          },
          "e": {
            "c": 2,
            "r": 0
          }
        }
      ],
      "A1": {
        "v": "This is a submerged cell",
        "s": {
          "border": {
            "left": {
              "style": "thick",
              "color": {
                "auto": 1
              }
            },
            "top": {
              "style": "thick",
              "color": {
                "auto": 1
              }
            },
            "bottom": {
              "style": "thick",
              "color": {
                "auto": 1
              }
            }
          }
        },
        "t": "s"
      },
      "B1": {
        "v": "Pirate ship",
        "s": {
          "border": {
            "top": {
              "style": "thick",
              "color": {
                "auto": 1
              }
            },
            "bottom": {
              "style": "thick",
              "color": {
                "auto": 1
              }
            }
          }
        },
        "t": "s"
      }
    }
  }
}

image