Brief description of requirements:
When using the document library view to present content data, it is inevitable that a column is similar to long fields such as "details" and "Description", but it is not so satisfied that the style is automatically controlled, it is important to set the column width of a column in the document library or list library...
...............
Implementation routine:
First, let's take a look at the current library list without any settings: the column named "con" automatically adjusts the column width according to the width of the content (the "con" column is the newly created multiple line textbox ), however, it is always uncomfortable for viewers. next we will change its appearance style step by step.
First, let's take a look at the source code of the current page (it is best to use the webpage code editing tool. It is not recommended to directly edit this page with SharePoint designer because allitems is opened. aspx file, and here we mainly analyze the HTML code from response to the client, and then modify its style sheet)
The client code corresponding to con is marked as: <TH class = "ms-vh2-nograd" Scope = "col" nowrap = true>
Open the list library with SharePoint designer and go to the allitem. ASPX page to find the following code area:
<Asp: Content contentplaceholderid = "placeholdermain" runat = "server">
<Webpartpages: webpartzone runat = "server" frametype = "NONE" id = "Main" Title = "LOC: Main"> <zonetemplate>
Change
<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>
Save allitem. aspx and publish to view the effect:
Is it a significant improvement?
Analysis:
In fact, this demo is not a perfect solution, because now we control the ms-vh2-nograd class in the style sheet, If I create a multiple line textbox type field in this list, then it is clear that this column will also follow the style definition of the ms-vh2-nograd class ......