StupidBeauty
Read times:229Posted at:Thu Apr 28 00:09:21 2011
- no title specified

Wt3.1.9文档翻译:WTable类参考,WTable Class Reference

这是一个容器部件,用一个表格来为子代部件提供布局支持

一个WTable在表格中为它的子代部件安排位置

要想插入或者访问内容的话,就使用 elementAt(int row, int column) 来访问表格中特定位置的 单元格 WTable会自动扩张,以在必要的时候创建指定的 (row, column)。

可以使用以下方法来在表格中插入或者删除整个的行或者列 insertColumn(int column) insertRow(int row) deleteColumn(int column) 或者 deleteRow(int row)

你可以使用setHeaderCount()来指定某些行和列来充当表头。表头单元格会被渲染成 <th> 元素 ,而不是 <td> 元素。默认地 ,没有行或者列被当成表头

WTable是以的形式显示的

使用示例:

Wt::WTable *table = new Wt::WTable(this);

 table->elementAt(0, 0)->addWidget(new Wt::WText("Item @ row 0, column 0"));

 table->elementAt(0, 1)->addWidget(new Wt::WText("Item @ row 0, column 1"));

 table->elementAt(1, 0)->addWidget(new Wt::WText("Item @ row 1, column 0"));

 table->elementAt(1, 1)->addWidget(new Wt::WText("Item @ row 1, column 1"));

Wt::WTableCell *cell = table->elementAt(2, 0);

 cell->addWidget(new Wt::WText("Item @ row 2"));

 cell->setColumnSpan(2);

CSS

这个部件对应于HTML 的<table>标签,不提供样式支持 。它可以通过内联或者外部 CSS 的方式来进行样式设置

参见

WTableCell, WTableRow, WTableColumn

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4