React-table: How to specify colspan in a row ?

Created on 28 Feb 2018  路  2Comments  路  Source: tannerlinsley/react-table

What version of React-Table are you using?

Your bug may already be fixed in the latest release. Run yarn upgrade react-table!
v6.7.6

What bug are you experiencing, or what feature are you proposing?

Unable to specify colspan in a row. Need to specify a colspan of 4 in a 7 column row.

What are the steps to reproduce the issue?

NA

All 2 comments

Sorry - you can't. ReactTable is not a "normal" table and has no support for colspan or rowspan.

I was able to get this effect by using the getTdProps prop on the table by passing it this function and hiding the columns that I wanted:

  customTdProps = (state, rowInfo, column, instance) => {
      let className = 'meeting__td'
      const columnsNotHidden = ["col0", "col6", "col7", "col8", "col9" ]
      if (columnsNotHidden.indexOf(column.id) === -1 ) {
          className = `${className} hide-me`;
      }

      return {className};
  };
Was this page helpful?
0 / 5 - 0 ratings

Related issues

monarajhans picture monarajhans  路  3Comments

Abdul-Hameed001 picture Abdul-Hameed001  路  3Comments

Codar97 picture Codar97  路  3Comments

bdkersey picture bdkersey  路  3Comments

dwjft picture dwjft  路  3Comments