表头冻结列冻结_如何在Excel中冻结和取消冻结行和列

表头冻结列冻结

表头冻结列冻结

If you are working on a large spreadsheet, it can be useful to “freeze” certain rows or columns so that they stay on screen while you scroll through the rest of the sheet.

如果您使用的是大型电子表格,则“冻结”某些行或列以使它们在滚动表的其余部分时保留在屏幕上会很有用。

As you’re scrolling through large sheets in Excel, you might want to keep some rows or columns—like headers, for example—in view. Excel lets you freeze things in one of three ways:

当您在Excel中滚动浏览大型工作表时,您可能希望在视图中保留一些行或列(例如标题)。 Excel使您可以通过以下三种方式之一冻结内容:

  • You can freeze the top row.

    您可以冻结第一行。
  • You can freeze the leftmost column.

    您可以冻结最左边的列。
  • You can freeze a pane that contains multiple rows or multiple columns—or even freeze a group of columns and a group of rows at the same time.

    您可以冻结包含多行或多列的窗格,甚至可以同时冻结一组列和一组行。

So, let’s take a look at how to perform these actions.

因此,让我们看一下如何执行这些操作。

冻结第一行 (Freeze the Top Row)

Here’s the first spreadsheet we’ll be messing with. It’s the Inventory List template that comes with Excel, in case you want to play along.

这是我们将要使用的第一个电子表格。 如果您想一起玩的话,这是Excel随附的库存清单模板。

The top row in our example sheet is a header that might be nice to keep in view as you scroll down. Switch to the “View” tab, click the “Freeze Panes

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Qt,TabWidget是一个常用控件,用于创建具有多个选项卡的用户界面。要冻结TabWidget的表头,我们可以使用QHeaderView类和QTableWidget类。 首先,我们需要创建一个QTableWidget实例,并设置其数和数。然后,我们可以使用setVerticalHeader和setHorizontalHeader方法来设置表头。接下来,我们需要使用setHorizontalHeaderItem方法为每一设置表头项。 要冻结表头,我们可以使用QHeaderView类的setHorizontalScrollMode方法将水平滚动模式设置为ScrollPerPixel,这样当我们滚动表格时,表头仍然保持固定。 要冻结,我们可以使用QHeaderView类的setVerticalScrollMode方法将垂直滚动模式设置为ScrollPerPixel,这样当我们滚动表格时,仍然保持固定。 综上所述,以下是一个示例代码: ```cpp QTableWidget* tableWidget = new QTableWidget(parent); tableWidget->setRowCount(rowCount); tableWidget->setColumnCount(columnCount); QHeaderView* verticalHeader = tableWidget->verticalHeader(); verticalHeader->setSectionResizeMode(QHeaderView::Fixed); //设置固定高 QHeaderView* horizontalHeader = tableWidget->horizontalHeader(); horizontalHeader->setSectionResizeMode(QHeaderView::Fixed); //设置固定宽 //设置表头 tableWidget->setHorizontalHeaderLabels(horizontalHeaders); tableWidget->setVerticalHeaderLabels(verticalHeaders); //冻结表头 horizontalHeader->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); verticalHeader->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); ``` 以上就是使用Qt的TabWidget冻结表头的方法。希望对你有帮助!如果还有其他问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值