## Tabulars

A tabular is a component designed to lay out other components. Unlike a table component, that is used to display a dataset, a tabular is a set of cells that can each display a dataset in a component.

### Inserting a tabular in a report

A tabular can be inserted in the report areas listed in Component placement.

To insert a tabular into a report, use either of the following ways:

- Using dialog
  1. Do one of the following to bring out the Insert Tabular dialog:
     - Click Insert > Tabular on the menu bar.
     - Click the Insert Tabular button on the Insert toolbar.
  2. Specify the number of rows and columns, and the border width and tabular width as required.
  3. Click the OK button to close the dialog.

     If the mouse pointer is in the report body or a cell of another tabular, the tabular will be inserted there upon clicking OK. Otherwise, you need to click the mouse button in the desired location to place the tabular there.

- By dragging and dropping

  From the Toolbox panel, drag Tabular to the desired location in the report which allows the insertion of a tabular, and a tabular will then be created there.

After a tabular has been created in a report, you can then:

- Insert the required components into the tabular cells. The components that can be inserted into a tabular cell are listed in Component placement.
- Double-click a tabular cell and then input and modify text in it.

You can also customize the tabular appearance and behavior by setting properties in the Report Inspector, which can be saved as a CSS style for future use (for details, see Creating a CSS style).

### Merging and splitting tabular cells

In a tabular, adjacent cells that form a rectangle can be merged into one cell.

- To merge adjacent cells, select them, right-click and select Merge from the shortcut menu (or click the Merge button on the Standard toolbar). These cells will then be merged into one cell.
- To split a cell, follow the steps below:
  1. Right-click the cell and select Split from the shortcut menu.
  2. In the Split Cell dialog, check whether the cell will be split into rows or columns, and then specify how many rows/columns the cell will be split into.
  3. Click OK, and the cell will then be split according to your selection.

### Resizing, inserting and deleting columns/rows in a tabular

- To resize a column of a tabular, drag the boundary on the right side of the column until the column is the width you want. To resize a row, drag the boundary below the row until the row is the height you want.
- To insert a column/row into a tabular, select a cell and right-click it. On the shortcut menu, click the corresponding inserting column/row item and a column/row will then be inserted according to your selection.
- To delete a column/row from a tabular, select all the cells in this column/row, right-click, and then select Delete Column/Delete Row from the shortcut menu.

### Formatting text and paragraphs in a tabular cell

The text and paragraphs you create in a tabular cell can be easily formatted according to your requirements. For example, you can change the font face, font color of the text, the indentation of any paragraph. You can even find and replace a text string with another one easily as with a word processor. For detail, refer the specific topics in the Text boxes section.

See an example: The SampleComponents catalog, included with JReport Designer, contains reports that have examples of how each component type could be used in a report. For the tabular component example, open `<install_root>\Demo\Reports\SampleComponents\TabularReport.cls`.