惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Cisco Talos Blog
Cisco Talos Blog
C
Check Point Blog
博客园_首页
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
S
Security @ Cisco Blogs
L
LINUX DO - 最新话题
博客园 - 司徒正美
P
Privacy International News Feed
G
Google Developers Blog
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
K
Kaspersky official blog
I
InfoQ
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Webroot Blog
Webroot Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
大猫的无限游戏
大猫的无限游戏
D
Docker
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Microsoft Azure Blog
Microsoft Azure Blog
Spread Privacy
Spread Privacy
量子位
H
Hacker News: Front Page
Simon Willison's Weblog
Simon Willison's Weblog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
SecWiki News
SecWiki News
S
Security Affairs
Latest news
Latest news
人人都是产品经理
人人都是产品经理
C
CERT Recently Published Vulnerability Notes
S
Security Archives - TechRepublic
V
Visual Studio Blog
T
Troy Hunt's Blog
S
Secure Thoughts
F
Fortinet All Blogs
V
V2EX
The Register - Security
The Register - Security
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - Razor#

Biztalk SQL 适配器之数据类型支持 Biztalk 32Bit or 64Bit ?Event ID 5754 Sharepoint 开发心得No.4: [转载]Feature.xml文件介绍 Sharepoint 开发心得No.3: 自定义列(Field)开发 Sharepoint 开发心得No.1: 列表(文档库)级别是否可见设置 - Razor# How to install Application Templates on WSS3.0 VS2008发布Sharepoint工作流时Infopath模板问题 Contact Selector控件 Biztalk 2006基础认知 字符编码格式小结(ASCII/Unicode/UTF-8) Sharepoint 2007 Sdk常用基础操作 Sharepoint 2007部署Webpart的方式(二):STSDEV开发dotnet 3.5的webpart Sharepoint2007 部署Webpart的方式(一) Windows SharePoint Services 3.0 Service Pack 1 VS2008构建MOSS表单工作流 MOSS 工作流开发中关于Workflow.xml feature.xml Sharepoint 工作流基础 InfoPath2007 创建安全的数字证书模板发布(Domain Certificate Authority Signing InfoPath 2007 Forms) 用证书实现windows 2003下IIS的SSL安全通信 - Razor#
Sharepoint 开发心得No.2: 列表(文档库)列宽设置
Razor# · 2009-02-16 · via 博客园 - Razor#

需求简述:
在用文档库视图呈现内容数据时,难免有那么一列类似于"详细信息""描述"等长字段内容的,又苦于自动控制样式做的不是那么满意,那设置文档库或列表库某一列的列宽就显得比较重要了...

...............
实现套路:

先看一下未进行任何设置的当前库列表: 名为"con"的列按照内容的宽度自动调整列宽度("con"列是新建的Multiple Line Textbox),但在浏览者眼里始终有些不太舒服.下面就来一步步改变它的外观样式11.GIF
首先看一下当前页面的源代码(最好用网页代码编辑工具,不推荐直接将本页面用Sharepoint Designer编辑,因为打开的是AllItems.aspx文件,而这里我们主要分析的是Response到客户端的HTML代码, 进而修改它的样式表)
12.GIF

可以看到"con"对应的客户端代码标记为: 

<TH class="ms-vh2-nograd" scope="col" noWrap=True>

现在用Sharepoint Designer打开该列表库,将定位到AllItem.aspx页面找到如下代码区:

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
    
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>


修改为

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<style type="text/css">   
     .ms-vh2-nograd
{   
     width
:300px;   
     
}   
</style> 
    
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>

保存AllItem.aspx并Publish, 查看效果:
13.GIF

是不是明显改观了? :)

分析:
其实本demo并非完美解决方案,因为现在控制的是样式表中的 ms-vh2-nograd 这个类, 如果我在这个List中再新建一个Multiple Line Textbox类型的字段,那么很显然这个列也会遵从ms-vh2-nograd 这个类的样式定义......