Column صف

Column صف

يمثل عمودًا واحدًا في ورقة العمل.

يكشف النوع Column عن الأعضاء التاليين:

ملكيات

ملكيةوصف
indexيحصل على فهرس هذا العمود.
widthيحصل على عرض العمود ويحدده بوحدة الأحرف.
group_levelيحصل على مستوى المجموعة للعمود.
is_hiddenيشير إلى ما إذا كان العمود مخفيًا.
has_custom_styleيشير إلى ما إذا كان هذا العمود يحتوي على إعدادات نمط مخصصة (تختلف عن الإعدادات الافتراضية الموروثة من المصنف).
styleيحصل على نمط هذا العمود.
is_collapsedما إذا كان العمود قد انهار

طُرق

طريقةوصف
apply_style(self, style, flag)يتم تطبيق التنسيقات على العمود بأكمله.
get_style(self)يحصل على نمط هذا العمود.
set_style(self, style)تعيين نمط هذا العمود.

مثال

from aspose.cells import BackgroundType, StyleFlag, Workbook
from aspose.pydrawing import Color

# Instantiating a Workbook object
workbook = Workbook()
# Obtaining the reference of the first worksheet
worksheet = workbook.worksheets[0]
style = workbook.create_style()
# Setting the background color to Blue
style.background_color = Color.blue
# Setting the foreground color to Red
style.foreground_color = Color.red
# setting Background Pattern
style.pattern = BackgroundType.DIAGONAL_STRIPE
# New Style Flag
styleFlag = StyleFlag()
# Set All Styles
styleFlag.all = True
# Get first Column
column = worksheet.cells.columns[0]
# Apply Style to first Column
column.apply_style(style, styleFlag)
# Saving the Excel file
workbook.save("book1.xls")

أنظر أيضا