Skip to content

Commit ca566c9

Browse files
committed
update editing_worksheets.rst
1 parent 7af6792 commit ca566c9

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

editing_worksheets.rst

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,42 @@
1-
Inserting and deleting rows and columns, moving ranges of cells
1+
插入删除行或列, 移动范围单元格
22
===============================================================
33

44

5-
Inserting rows and columns
5+
插入行和列
66
--------------------------
77

8-
You can insert rows or columns using the relevant worksheet methods:
8+
你可以使用工作表相关的方法来插入行和列:
99

1010
* :func:`openpyxl.worksheet.worksheet.Worksheet.insert_rows`
1111
* :func:`openpyxl.worksheet.worksheet.Worksheet.insert_cols`
1212
* :func:`openpyxl.worksheet.worksheet.Worksheet.delete_rows`
1313
* :func:`openpyxl.worksheet.worksheet.Worksheet.delete_cols`
1414

15-
The default is one row or column. For example to insert a row at 7 (before
16-
the existing row 7)::
15+
默认是一行或一列。 例如在第七行插入一行 (存在第七行)::
1716

1817
>>> ws.insert_rows(7)
1918

2019

21-
Deleting rows and columns
20+
删除多行或多列
2221
--------------------------
2322

24-
To delete the columns ``F:H``::
23+
删除 ``F:H``::
2524

2625
>>> ws.delete_cols(6, 3)
2726

2827

2928
Moving ranges of cells
3029
----------------------
3130

32-
You can also move ranges of cells within a worksheet::
31+
你也可以在一个工作表内移动范围单元格::
3332

3433
>>> ws.move_range("D4:F10", rows=-1, cols=2)
3534

36-
This will move the cells in the range ``D4:F10`` up one row, and right two
37-
columns. The cells will overwrite any existing cells.
35+
这会将 ``D4:F10`` 单元格向上移动一行向右移动两列,已存在的单元格将会被覆盖
3836

39-
If cells contain formulae you can let openpyxl translate these for you, but
40-
as this is not always what you want it is disabled by default. Also only the
41-
formulae in the cells themselves will be translated. References to the cells
42-
from other cells or defined names will not be updated; you can use the
43-
:doc:`formula` translator to do this::
37+
如果单元格包含公式,你可以让 openpyxl 帮你进行translate,但也并非总是你想要的结果,因此默认是禁用的。
38+
同时,只有单元格本身的公式将会被translate。其他单元格对该单元格的引用或defined name将不会被更新。你可以使用 :doc:`formula` 来做这件事::
4439

4540
>>> ws.move_range("G4:H10", rows=1, cols=1, translate=True)
4641

47-
This will move the relative references in formulae in the range by one row and one column.
42+
公式中的相对引用移动一行和一列

0 commit comments

Comments
 (0)