worksheet 中常用属性之 sheetPr

sheetPr 介绍

<sheetPr>(Sheet Properties)元素位于Office Open XML(OOXML)中的工作表文件(如 xl/worksheets/sheet1.xml)的<worksheet>元素内,用于表示工作表的一些属性和设置。

sheetPr 在 OOXMl 中的完整定义如下:

它是 worksheet 的一个子标签:

xml 复制代码
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{C1AD1125-A99D-A04A-BA47-D7D9151D32C6}">
  <sheetPr filterMode="1"/>
</worksheet>

常见属性

tabColor

用于表示工作表标签颜色的元素。它包含以下属性:

  • rgb:一个字符串,表示工作表标签颜色的十六进制RGB值。例如,rgb="FFFF00"表示黄色。
  • indexed:一个整数值,表示工作表标签颜色在Excel颜色索引表中的位置。例如,indexed="6"表示使用索引为6的颜色。
  • theme:一个整数值,表示工作表标签颜色在当前主题颜色方案中的位置。例如,theme="5"表示使用主题颜色方案中的第5个颜色。 关于 color , 后面会在单独的文章中介绍。

可以在 Excel 中通过子表右键菜单来设置工作表颜色。

filterMode

一个布尔值,表示工作表是否处于筛选模式。如果为true,则表示工作表处于筛选模式;如果为false或未设置,则表示工作表不处于筛选模式。此属性通常在Excel中自动设置,用于指示工作表的筛选状态。

在 excel 中, 如果设置了这个值的话, 会有如下的提示。

相关推荐
vipbic1 小时前
别再把“做个H5”挂嘴边了:这个词,官方压根就没有定义过
前端
红尘散仙2 小时前
我把终端小说阅读器接上了 AI Agent:TRNovel 现在能用 skill 生成书源了
人工智能·后端·rust
ZC跨境爬虫3 小时前
跟着 MDN 学CSS day_39:(Flexbox 弹性盒子核心机制)
前端·css·ui·html·tensorflow
小陈同学呦3 小时前
前端如何处理订单状态导航的数据竞态问题
前端·javascript
开发者每周简报3 小时前
网海三部曲·无名宗师传
javascript·人工智能
卷毛的技术笔记4 小时前
告别硬编码!Spring AI Alibaba 实现 AI Agent 智能工具调用(Tool Calling)
java·人工智能·后端·python·spring·ai编程
喵个咪4 小时前
GoWind Toolkit 前端代码生成|Vue3(ElementPlus/Vben)、React(AntDesign)全自动一键生成教程
前端·vue.js·react.js
会编程的土豆4 小时前
Go 语言反射(Reflection)详解
开发语言·后端·golang
喵个咪4 小时前
GoWind Toolkit Go后端代码生成 完整全流程实战
后端·go·orm
basketball6165 小时前
Go 语言从入门到进阶:4. 数组和MAP使用方法总结
开发语言·后端·golang