Title: adding a row with colspan
Last modified: April 8, 2017

---

# adding a row with colspan

 *  Resolved [gatta2](https://wordpress.org/support/users/gatta2/)
 * (@gatta2)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-a-row-with-colspan/)
 * Hi, I tried to use Jquery to add a row with colspan then the sorting doesn’t 
   working anymore.
 * jQuery(document).ready(function($) {
    $(‘#tablepress-12 > tbody >tr:first-child’).
   after(‘<tr><td colspan=”5″>test</td></tr>’); });
 * Is there any way to make sorting work with a row containing colspan?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [gatta2](https://wordpress.org/support/users/gatta2/)
 * (@gatta2)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-a-row-with-colspan/#post-9009520)
 * Actually removing the colspan also make sorting not work. The error is
 * Uncaught TypeError: Cannot set property ‘_DT_CellIndex’ of undefined
 *  Thread Starter [gatta2](https://wordpress.org/support/users/gatta2/)
 * (@gatta2)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-a-row-with-colspan/#post-9009559)
 * Solved by adding the same number of cells as the other rows.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-a-row-with-colspan/#post-9010326)
 * Hi,
 * yes, you will always need to add the correct amount of cells. I’m not sure that
   this data will be taken into account for the sorting, however.
    Adding a row 
   with colspan is probably not possible here, as the DataTables JS library does
   not support such tables.
 * Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

 The topic ‘adding a row with colspan’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/adding-a-row-with-colspan/#post-9010326)
 * Status: resolved