- Rows and Columns
- The Language of Apache OpenOffice Basic
- Overview of a Basic Program
- Working With Variables
- Boolean Values
- Date and Time
- Scope and Life Span of Variables
- Procedures and Functions
- Error Handling
- Other Instructions
- Runtime Library
- Conversion Functions
- Files and Directories
- Message and Input Boxes
- Other Functions
- Introduction to the API
- Universal Network Objects (UNO)
- Properties and Methods
- Modules, Services and Interfaces
- Tools for Working with UNO
- Overview of Central Interfaces
- Working with Documents
- The StarDesktop
- Styles and Templates
- Text Documents
- The Structure of Text Documents
- Editing Text Documents
- More than Just Text
- Spreadsheet Documents
- Cells and Ranges
- Formatting Spreadsheet Documents
- Editing Spreadsheet Documents
- Drawings and Presentations
- The Structure of Drawings
- Editing Drawing Objects
- Presentations
- Charts (Diagrams)
- Using Charts in Spreadsheets
- The Structure of Charts
- Chart Types
- SQL: a Query Language
- Types of Database Access
- Data Sources
- Database Access
- Working With Dialogs
- Dialog Control Elements
- Working With Forms
- Control Element Forms
- Database Forms
Each sheet contains a list of its rows and columns. These are available through the Rows and Columns properties of the spreadsheet object and support the com.sun.star.table.TableColumns and/or com.sun.star.table.TableRows services.
The following example creates two objects that reference the first row and the first column of a sheet and stores the references in the FirstCol and FirstRow object variables.
The column objects support the com.sun.star.table.TableColumn service that has the following properties:
The width of a column is only optimized when the OptimalWidth property is set to True . If the width of an individual cell is changed, the width of the column that contains the cell is not changed. In terms of functionality, OptimalWidth is more of a method than a property.
The row objects are based on the com.sun.star.table.TableRow service that has the following properties:
If the OptimalHeight property of a row is set to the True , the row height changes automatically when the height of a cell in the row is changed. Automatic optimization continues until the row is assigned an absolute height through the Height property.
The following example activates the automatic height optimization for the first five rows in the sheet and makes the second column invisible.
Inserting and Deleting Rows and Columns
The Rows and Columns objects of a sheet can access existing rows and columns as well as insert and delete them.
This example uses the insertByIndex method to insert a new column into the fourth column position in the sheet (index 3 - numbering starts at 0). The second parameter specifies the number of columns to be inserted (in this example: one).
The removeByIndex method deletes the sixth column (index 5). Again, the second parameter specifies the number of columns that you want to delete.
The methods for inserting and deleting rows use the Rows object function in the same way as the methods shown for editing columns using the Columns object.
- Documentation/BASIC Guide
- PDL License
- View source
Personal tools
- Recent changes
- Download AOO
- Documentation
- What links here
- Related changes
- Special pages
- Printable version
- Permanent link
- Page information
In other languages
Print/export.
- Create a book
- Download as PDF
- This page was last edited on 30 January 2021, at 13:26.
- Content is available under ALv2 unless otherwise noted.
- Privacy policy
- About Apache OpenOffice Wiki
- Disclaimers
User community support forum for Apache OpenOffice, LibreOffice and all the OpenOffice.org derivatives
Skip to content
- Board index Getting started Tutorials Writer
[Tutorial] Columns in Writer: an introduction
Post by RoryOF » Tue Feb 07, 2017 6:30 pm
Return to “Writer”
- Getting started
- ↳ Survival guide
- ↳ Beginners
- ↳ Getting Started Guide for 4.x
- ↳ Getting Started Guide for 3.x
- ↳ Install, Setup and Troubleshooting
- ↳ Admin Guide
- ↳ MS Windows
- ↳ Linux
- ↳ Mac OSX
- ↳ LibreOffice
- ↳ Tablets
- ↳ Tutorials
- ↳ Writer
- ↳ Calc
- ↳ Base
- Applications
- ↳ Writer Guide for 4.x
- ↳ Writer Guide for 3.x
- ↳ Writer Tutorials
- ↳ Templates
- ↳ Advanced Uses
- ↳ Calc Guide for 4.x
- ↳ Calc Guide for 3.x
- ↳ Calc Functions
- ↳ Calc Tutorials
- ↳ Impress
- ↳ Impress Guide for 4.x
- ↳ Impress Guide for 3.x
- ↳ Draw
- ↳ Draw Guide for 4.x
- ↳ Draw Guide for 3.x
- ↳ Math
- ↳ Math Guide for 4.x
- ↳ Math Guide for 3.x
- ↳ Base Guide for 4.x
- ↳ Wiki
- ↳ Base Tutorials
- ↳ Tables & Queries
- ↳ Forms
- ↳ External Data Sources
- ↳ Reporting
- ↳ Database Examples
- Customizing and Extending
- ↳ Macros and UNO API
- ↳ Basic Guide
- ↳ Code Snippets
- ↳ Extension Repository
- ↳ Macro Repository
- ↳ External Programs
- ↳ Extensions
- ↳ Extensions page
- ↳ General Discussion
- ↳ Site Feedback
- ↳ Forum Governance
- ↳ User Experience (UX)
- ↳ Announcements
- ↳ Institutions & Educational
- ↳ Paid support
- ↳ Consultants Directory
- Board index
- All times are UTC
Powered by phpBB ® Forum Software © phpBB Limited
Privacy | Terms
IMAGES
VIDEO