Skip to main content

Work with rows and columns

DHTMLX Spreadsheet allows adding/removing columns and rows, automatically fitting the column width to the content, freezing/unfreezing columns and rows, as well as hiding/showing columns and rows via toolbar buttons, menu options and the options of the context menu of a cell.

Adding/removing rows and columns

Adding rows

To add a new row, take the following steps:

1. Select a row (by clicking on its header) or a cell in the necessary row.

2. Choose one of the following actions:

  • either click the Rows button in the toolbar and select the Add row above option

Adding rows toolbar

  • or select the Insert menu option and choose Rows -> Add row above

Adding rows menu

  • or right-click the row or a cell in the row and choose Rows -> Add row above

Adding rows context menu

Removing rows

To remove a row, take the following steps:

1. Select a row (by clicking on its header) or a cell in the row.

2. Choose one of the following actions:

  • click the Rows button in the toolbar and select the Remove row option

Removing rows toolbar

  • or select the Insert menu option and choose Rows -> Remove row

Removing rows menu

  • or right-click the row or a cell in the row and choose Rows -> Remove row

Removing rows context menu

Adding columns

To add a new column, take the following steps:

1. Select a column (by clicking on its header) or a cell in the necessary column.

2. Choose one of the following actions:

  • either click the Columns button in the toolbar and select the Add column left option

Adding columns toolbar

  • or select the Insert menu option and choose Columns -> Add column left

Adding columns menu

  • or right-click the column or a cell in the column and choose Columns -> Add column left

Adding columns

Removing columns

To remove a column, take the following steps:

1. Select a column (by clicking on its header) or a cell in the column.

2. Choose one of the following actions:

  • click the Columns button in the toolbar and select the Remove column option

Adding columns toolbar

  • or select the Insert menu option and choose Columns -> Remove column

Removing columns menu

  • or right-click the column or a cell in the column and choose Columns -> Remove column

Adding columns context menu

AutoFit column width

To change the column width so that it would automatically fit the longest content in the column, you can:

  • double-click the resize cursor of a column in the table header

Autofit column width

  • or take the following steps:

1. Left-click on a 3 dots icon of the column

Column context menu

2. Choose Columns -> Fit to data

Autofit column width

Freezing/unfreezing rows and columns

Freezing rows

To freeze rows up to a certain row, take the following steps:

1. Select a row (by clicking on its header) or a cell in the necessary row.

2. Choose one of the following actions:

  • either click the Rows button in the toolbar and select the Freeze up to row [id] option

Freezing rows toolbar

  • or select the Edit menu option and choose Freeze -> Freeze up to row [id]

Freezing rows menu

  • or right-click a row or a cell in the row and choose Rows -> Freeze up to row [id]

Freezing rows context menu

Unfreezing rows

(In the images below rows are frozen up to the row 5)

To unfreeze rows, take one of the following steps:

  • either click the Rows button in the toolbar and select the Unfreeze rows option

Unfreezing rows toolbar

  • or select the Edit menu option and choose Freeze -> Unfreeze rows

Unfreezing rows menu

  • or right-click any cell and choose Rows -> Unfreeze rows

Unfreezing rows context menu

Freezing columns

To freeze columns up to a certain column, take the following steps:

1. Select a column (by clicking on its header) or a cell in the necessary column.

2. Choose one of the following actions:

  • either click the Columns button in the toolbar and select the Freeze up to column [id] option

Freezing columns toolbar

  • or select the Edit menu option and choose Freeze -> Freeze up to column [id]

Freezing columns menu

  • or right-click a column or a cell in the column and choose Columns -> Freeze up to column [id]

Freezing columns context menu

Unfreezing columns

(In the images below columns are frozen up to the column D)

To unfreeze columns, take one of the following steps:

  • either click the Columns button in the toolbar and select the Unfreeze columns option

Unfreezing columns toolbar

  • or select the Edit menu option and choose Freeze -> Unfreeze columns

Unfreezing columns menu

  • or right-click any cell and choose Columns -> Unfreeze columns

Unfreezing columns context menu

Hiding/showing rows and columns

Hiding rows

To hide a row, take the following steps:

1. Select a row (by clicking on its header) or a cell in the necessary row.

2. Choose one of the following actions:

  • either click the Rows button in the toolbar and select the Hide row(s) [id] option

Hiding rows toolbar

  • or right-click a row or a cell in the row and choose Rows -> Hide row(s) [id]

Hiding rows context menu

Showing rows

To show hidden rows, take one of the following steps:

  • either click the "arrows" icon that appears in the rows header instead of the hidden row/rows

(In the image below the rows 8 and 11 are hidden)

Showing rows

  • or select rows or several cells so that the hidden rows were included into the selection, right-click to call the context menu and choose Rows -> Show rows

(In the image below the row 8 is hidden)

Showing rows context menu

Hiding columns

To hide a column, take the following steps:

1. Select a column (by clicking on its header) or a cell in the necessary column.

2. Choose one of the following actions:

  • either click the Columns button in the toolbar and select the Hide column(s) [id] option

Hiding columns toolbar

  • or right-click a column or a cell in the column and choose Columns -> Hide column(s) [id]

Hiding columns context menu

Showing columns

To show hidden columns, take one of the following steps:

  • either click the "arrows" icon that appears in the columns header instead of the hidden column/columns

(In the image below the columns C and E are hidden)

Showing columns

  • or select columns or several cells so that the hidden columns were included into the selection, right-click to call the context menu and choose Columns -> Show columns

(In the image below the column C is hidden)

Showing columns context menu