css设定表格宽度
来源:互联网 发布:免费刷cf点软件 编辑:程序博客网 时间:2024/05/23 11:47
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
你真的不会css?那你先找一下css的资料吧。
比如你的css文件里面有以下内容:
Class1{width:20%;}
Class2{width:30%;}
然后写你的DataGrid,你不要使用它默认的写法,将AutoGenrated(这个单词我忘了怎么拼了)设置为false,然后自己绑定到DataGrid里面的模板里面,在每一项里面设置,老天,我刚才又看了一下你的贴子,这才明白,你只是使用的DataGrid的原始功能呀?
看看下面的写法:
<asp:DataGrid id="programmaticID" runat=server
DataSource='<%# DataBindingExpression %>'
AutoGenerateColumns="False"
(other properties)>
<Columns>
<asp:BoundColumn
DataField="DataSourceField"
DataFormatString="FormatString"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Visible="True|False"
FooterStyle-property="value"
HeaderStyle-property="value"
ItemStyle-property="value"
/>
<asp:ButtonColumn
ButtonType="LinkButton|PushButton"
Command="BubbleText"
DataTextField="DataSourceField"
DataTextFormatString="FormatString"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Text="ButtonCaption"
Visible="True|False"
/>
<asp:EditCommandColumn
ButtonType="LinkButton|PushButton"
CancelText="CancelButtonCaption"
EditText="EditButtonCaption"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
UpdateText="UpdateButtonCaption"
Visible="True|False"
/>
<asp:HyperLinkColumn
DataNavigateUrlField="DataSourceField"
DataNavigateUrlFormatString="FormatExpression"
DataTextField="DataSourceField"
DataTextFormatString="FormatExpression"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
NavigateUrl="url"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Target="window"
Text="HyperLinkText"
Visible="True|False"
/>
<asp:TemplateColumn>
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Visible="True|False"
<HeaderTemplate>
Header template HTML
</HeaderTemplate >
<ItemTemplate>
ItemTemplate HTML
</ItemTemplate>
<EditItemTemplate>
EditItem template HTML
</EditItemTemplate>
<FooterTemplate>
Footer template HTML
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
然后你可以为每一个模板指定一个cssClass了,或者直接在里面设置,就不必再使用C
css设定表格宽度';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
靠!你真的不会css?那你先找一下css的资料吧。
比如你的css文件里面有以下内容:
Class1{width:20%;}
Class2{width:30%;}
然后写你的DataGrid,你不要使用它默认的写法,将AutoGenrated(这个单词我忘了怎么拼了)设置为false,然后自己绑定到DataGrid里面的模板里面,在每一项里面设置,老天,我刚才又看了一下你的贴子,这才明白,你只是使用的DataGrid的原始功能呀?
看看下面的写法:
<asp:DataGrid id="programmaticID" runat=server
DataSource='<%# DataBindingExpression %>'
AutoGenerateColumns="False"
(other properties)>
<Columns>
<asp:BoundColumn
DataField="DataSourceField"
DataFormatString="FormatString"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Visible="True|False"
FooterStyle-property="value"
HeaderStyle-property="value"
ItemStyle-property="value"
/>
<asp:ButtonColumn
ButtonType="LinkButton|PushButton"
Command="BubbleText"
DataTextField="DataSourceField"
DataTextFormatString="FormatString"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Text="ButtonCaption"
Visible="True|False"
/>
<asp:EditCommandColumn
ButtonType="LinkButton|PushButton"
CancelText="CancelButtonCaption"
EditText="EditButtonCaption"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
UpdateText="UpdateButtonCaption"
Visible="True|False"
/>
<asp:HyperLinkColumn
DataNavigateUrlField="DataSourceField"
DataNavigateUrlFormatString="FormatExpression"
DataTextField="DataSourceField"
DataTextFormatString="FormatExpression"
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
NavigateUrl="url"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Target="window"
Text="HyperLinkText"
Visible="True|False"
/>
<asp:TemplateColumn>
FooterText="FooterText"
HeaderImageUrl="url"
HeaderText="HeaderText"
ReadOnly="True|False"
SortField="DataSourceFieldToSortBy"
Visible="True|False"
<HeaderTemplate>
Header template HTML
</HeaderTemplate >
<ItemTemplate>
ItemTemplate HTML
</ItemTemplate>
<EditItemTemplate>
EditItem template HTML
</EditItemTemplate>
<FooterTemplate>
Footer template HTML
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
然后你可以为每一个模板指定一个cssClass了,或者直接在里面设置,就不必再使用C
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- css设定表格宽度
- table css样式设定中的宽度设定
- css中body宽度的设定
- 用CSS样式固定表格宽度
- 让文字自动适应表格宽度(CSS)
- 用CSS样式固定表格宽度
- CSS让表格宽度适应内容
- css 固定HTML表格的宽度
- CSS将边框border设定到宽度和高度中
- CSS将边框border设定到宽度和高度中
- 超过表格宽度用“...”代替的CSS代码
- CSS中设置表格TD宽度的问题
- 网页宽度设定
- 页面最小宽度设定
- 自定义Dialog宽度设定
- CSS技巧,容器设定指定宽度,文字内容会自动换行,一长串英文不会
- “IE浏览器不支持在css文件中设定的dialog宽度”解决方法
- html的表格设定
- C# 2.0 Specification(迭代器)(一)
- 用文本文件制作留言板提示(下)
- c#中分割字符串的几种方法
- 建立动态的WML站点(二)
- C# 2.0 Specification(迭代器)(二)
- css设定表格宽度
- PHP的FTP学习(四)
- 用C#创建Windows(NT)服务
- C#, 程序员的新工具
- 自定义的转换格式
- 吐血奉献:如何搞定DataGrid 分栏的大小(即DataGrid的可视化控制).
- 用文本文件制作留言板提示(上)
- .net里面的数值格式变换
- 杏林同学录(九)