1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
.. SPDX-License-Identifier: BSD-2-Clause
Copyright 2013-2023, John McNamara, jmcnamara@cpan.org
.. _ex_hide_row_col:
Example: Hiding Rows and Columns
================================
This program is an example of how to hide rows and columns in XlsxWriter.
An individual row can be hidden using the :func:`set_row` method::
worksheet.set_row(0, None, None, {'hidden': True})
However, in order to hide a large number of rows, for example all the rows
after row 8, we need to use an Excel optimization to hide rows without setting
each one, (of approximately 1 million rows). To do this we use the
:func:`set_default_row` method.
Columns don't require this optimization and can be hidden using
:func:`set_column`.
.. image:: _images/hide_row_col.png
.. literalinclude:: ../../../examples/hide_row_col.py
|