JSFiddle - React, Tailwind, and code Playground

by dixalex

JavaScript

function LoadPage() {
  var mode = "%[Survey_Mode]Q22%";

  if (iqd) {mode = "2";}

  var repeat = (mode == "2") ? parseInt($('.tr-choice-row').closest('table').find('tr').length / 2, 10).toString() : 'bottom';
  var topicWidth = (mode == "1") ? '375px' : '350px';
  var columnWidth = (mode == "1") ? '120px' : '110px';
  var heightWidth = (mode == "1") ? '30px' : '30px';

  SetupTable({
    validate: 'none',
    repeatHeader: {
      repeatCount: repeat,
      includeAnchor: true,
      includeCategory: true,
      repeatMax: null
    },
    columnWidth: {
      topic: topicWidth,
      choice: columnWidth
    },
    formatRow: {
      height: heightWidth
    }
  });
}