導航:首頁 > 萬維百科 > 網頁設計tablecell

網頁設計tablecell

發布時間:2020-12-14 11:35:59

1、html中,如何固定table單元格寬度?

1、首先我們打開我來們的源myeclipse獲取idea這樣的編輯器,然後在編輯器中寫一個table標簽,這里注意給出table的值。

2、然後我們可以在頁面中看到此時展示的是沒有樣式的table樣板,此時所有的數據沒有經過渲染,比較緊湊,也不是一個頁面展示。

3、在table中引入樣式標簽style來設計table的樣式,代碼為style="width: 100%; max-width: 100%;margin-bottom: 20px;"表示佔用屏幕寬度的100%。

4、設置了屏幕展示table寬度後我們可以看到此時展示的樣式如下,樣式中數據已經充分展開。

5、使用jquery ,在jquery中首先給table一個class屬性,然後在JavaScript中通過.class屬性獲取這個table,然後給出樣式設計。

6、根據上面的設計我們再經過背景、寬度、高度的設計我們可以設計出一個比較好看的table。

2、table cell是什麼意思

table cell
表格單元; 表格單元格;
[例句]The selection includes a table cell boundary. Deleting and copying are not allowed.
選擇的對象中包含了表格單元邊界。不允專許進行復制或刪除屬。

3、如何設置table中某個cell(td)字體大小

用Dreamweaver建一個新頁,測試CSS用,方便。

CSS麻煩,不是美工的話知道怎樣可以生成,可以看懂就OK了,不用全記的。

4、在table中,rowspan和cellspan有什麼區別,試做一個網頁例子說明。

只有rowspan(表示該單元格向下合並多少個單元格)和colspan(表示向右合並多少個單元格)沒有cellspan

5、table-cell 是什麼意思

TableCell 對象代表一個 HTML 表格單元格。
在一個 HTML 文檔中 <td> 標簽每出現一次,一個 TableCell 對象就會被創建。

6、HtmlTableCell的問題

HtmlTableCell 和 HtmlTablerow 對應的是
<table>中 <td id="_td" runat="server"> 和 <tr id="_tr" runat="server">
注意這個 runat="server",它表示伺服器控制項
2003中,在HTML頁面的tr和td寫上 runat="server"後,還需要在後台專文件(.CS)中手屬動加上
protected System.Web.UI.HtmlControls.HtmlTableRow trButton;
才能在後台使用.
然後2005則是自動完成的,不會在頁面展現出來。
所以你如果僅僅是在HTML頁面上加入HtmlTablerow控制項.
那麼就直接在<tr> 裡面寫上 runat="server" 就可以了.
label 是ASP的伺服器控制項, 是無法對應 html的伺服器控制項的.

7、如何iOS 編程中使用自定義 TableViewCell

1.新建TableViewCell類,繼承父類為UITableViewCell

1.1 "TableCell.h"
#import <UIKit/UIKit.h>

/**
* 房間桌子顯示結構
* /
@interface TableCell : UITableViewCell {
  UILabel *tableNoLable; // 桌子號
  UIImageView *tableImageView; // 桌子圖片
UIImageView *tableStateImageView; // 桌子狀態圖片


@property (nonatomic ,retain) IBOutlet UILabel *tableNoLable;// 桌子號
@property (nonatomic ,retain) IBOutlet UIImageView *tableImageView;// 桌子圖片
@property (nonatomic ,retain) IBOutlet UIImageView *tableStateImageView;// 桌子狀態圖片

1.2 TableCell. m
#import "TableCell.h"
@implementation TableCell
@synthesize tableNoLable; // 桌子號
@synthesize tableImageView; // 桌子圖片
@synthesize tableStateImageView; // 桌子狀態圖片

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
// Initialization code
}
return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

- (void)dealloc {
[tableNoLable release];
[tableImageView release];

[hand3ImageView release];
[super dealloc];
}

@end

1.3 布置布局文件( xib 文件)指明 class 為自己定義的 tabelcellview
new 一個Empty Xib文件,其中不包含view, 在libriary中拖一個UITableCell到兩個圖標的框中,雙擊cellview,指明class為cell.m文件,開始編輯

2. 頁面中在 tableView 中載入自己的 cell

#import "TableCell.h"

// 設置房間桌子數
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
[Util showLog:@"numberOfRowsInSection"];
return g_Room.wTableCount;
}

// 設置單元格的高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
[Util showLog:@"heightForRowAtIndexPath"];
return kTableViewRowHeight;
}

// 設置單元個樣式
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
[Util showLog:@"cellForRowAtIndexPath start"];

static NSString *tableCellIdentifier = @"TableCellIdentifier";
TableCell *cell = (TableCell *)[tableView :tableCellIdentifier];
[Util showLog:@"TableCellIdentifier"];
if(cell == nil){
NSArray *nib = [[NSBundle mainBundle]loadNibNamed:@"TableCell" owner:self options:nil];
for(id oneObject in nib){
if([oneObject isKindOfClass:[TableCell class]]){
cell = (TableCell *)oneObject;

//***** 自己設計每個 cell 的內容,此函數會回調 table 的行數次,行數為 numberOfRowsInSection:(NSInteger)section 函數指定
// 顯示桌子號碼
NSUInteger row = [indexPath row] + 1;
NSString *str =[NSString stringWithFormat:@"%d",row];
cell.tableNoLable.text = [[@" 第 " stringByAppendingString:str] stringByAppendingString:@" 桌 "];
[Util showLog:@"tableNoLable"];

if(deskshowFlg){
// 獲取要繪畫的桌子信息
Desk *tempDesk = [g_DeskArray objectAtIndex:[indexPath row]];
}
}
}

8、如何在tableview的cell上添加不同的圖標

1.新建TableViewCell類,繼承父類為UITableViewCell

1.1 "TableCell.h"
#import <UIKit/UIKit.h>

/**
* 房間桌子顯示結構
* /
@interface TableCell : UITableViewCell {
  UILabel *tableNoLable; // 桌子號
  UIImageView *tableImageView; // 桌子圖片
UIImageView *tableStateImageView; // 桌子狀態圖片


@property (nonatomic ,retain) IBOutlet UILabel *tableNoLable;// 桌子號
@property (nonatomic ,retain) IBOutlet UIImageView *tableImageView;// 桌子圖片
@property (nonatomic ,retain) IBOutlet UIImageView *tableStateImageView;// 桌子狀態圖片

1.2 TableCell. m
#import "TableCell.h"
@implementation TableCell
@synthesize tableNoLable; // 桌子號
@synthesize tableImageView; // 桌子圖片
@synthesize tableStateImageView; // 桌子狀態圖片

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
// Initialization code
}
return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

- (void)dealloc {
[tableNoLable release];
[tableImageView release];

[hand3ImageView release];
[super dealloc];
}

@end

1.3 布置布局文件( xib 文件)指明 class 為自己定義的 tabelcellview
new 一個Empty Xib文件,其中不包含view, 在libriary中拖一個UITableCell到兩個圖標的框中,雙擊cellview,指明class為cell.m文件,開始編輯

2. 頁面中在 tableView 中載入自己的 cell

#import "TableCell.h"

// 設置房間桌子數
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
[Util showLog:@"numberOfRowsInSection"];
return g_Room.wTableCount;
}

// 設置單元格的高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
[Util showLog:@"heightForRowAtIndexPath"];
return kTableViewRowHeight;
}

// 設置單元個樣式
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
[Util showLog:@"cellForRowAtIndexPath start"];

static NSString *tableCellIdentifier = @"TableCellIdentifier";
TableCell *cell = (TableCell *)[tableView :tableCellIdentifier];
[Util showLog:@"TableCellIdentifier"];
if(cell == nil){
NSArray *nib = [[NSBundle mainBundle]loadNibNamed:@"TableCell" owner:self options:nil];
for(id oneObject in nib){
if([oneObject isKindOfClass:[TableCell class]]){
cell = (TableCell *)oneObject;

//***** 自己設計每個 cell 的內容,此函數會回調 table 的行數次,行數為 numberOfRowsInSection:(NSInteger)section 函數指定
// 顯示桌子號碼
NSUInteger row = [indexPath row] + 1;
NSString *str =[NSString stringWithFormat:@"%d",row];
cell.tableNoLable.text = [[@" 第 " stringByAppendingString:str] stringByAppendingString:@" 桌 "];
[Util showLog:@"tableNoLable"];

if(deskshowFlg){
// 獲取要繪畫的桌子信息
Desk *tempDesk = [g_DeskArray objectAtIndex:[indexPath row]];
}
}
}

9、html中table-cell代碼什麼用法

1、表格由 <table> 標簽來定義。每個表格均有若干行(由 <tr> 標簽定義),每行被分割為回若干單元答格(由 <td> 標簽定義)。字母 td 指表格數據(table data),即數據單元格的內容。數據單元格可以包含文本、圖片、列表、段落、表單、水平線、表格等等。
2、表格和邊框屬性
如果不定義邊框屬性,表格將不顯示邊框。有時這很有用,但是大多數時候,我們希望顯示邊框。
使用邊框屬性來顯示一個帶有邊框的表格:
<table border="1">
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
3、表格的表頭
表格的表頭使用 <th> 標簽進行定義。
大多數瀏覽器會把表頭顯示為粗體居中的文本:
4、表格中的空單元格
在一些瀏覽器中,沒有內容的表格單元顯示得不太好。如果某個單元格是空的(沒有內容),瀏覽器可能無法顯示出這個單元格的邊框。
5、注意:這個空的單元格的邊框沒有被顯示出來。為了避免這種情況,在空單元格中添加一個空格佔位符,就可以將邊框顯示出來。

10、table cell和table的不同

[tableView :@"cell" forIndexPath:indexPath]

官方描述為:
Returns a reusable table-view cell object for the specified reuse identifier and adds it to the table.
NS_AVAILABLE_IOS(6_0);

而回[tableView :@「答cell」]

官方描述為
Returns a reusable table-view cell object located by its identifier.
NS_AVAILABLE_IOS(2_0);

與網頁設計tablecell相關的知識