Yanachik.org

28 Feb, 2008

How to style a table for Sharepoint

Posted by: kyanachik In: ASP.Net

The Sharepoint GridView is not as fancy as the ASP.Net Listview, therefore it’s better to use an ASP.Net Listview to display a data table and style the table with the Sharepoint style classes.  Here are my notes on how to style a data table for Sharepoint:

 

Table

Table Style: border-style:None;width:100%;border-collapse:collapse;

Table Class: ms-listviewtable

Header Row Class: ms-viewheadertr

Header TH: ms-vh2-nofilter ms-vh2-gridview

Item TD: ms-vb2

 

Data Paging

The TD surrounding the DataPager: ms-listheaderlabel

Data Pager:

<asp:DataPager ID="DataPager1" runat="server" PageSize="10">

<Fields>

<asp:NextPreviousPagerField ButtonType="Image" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageImageUrl="/_layouts/1033/images/prev.gif" LastPageImageUrl="/_layouts/1033/images/prev.gif" NextPageImageUrl="/_layouts/1033/images/prev.gif" PreviousPageImageUrl="/_layouts/1033/images/prev.gif" />

<asp:NumericPagerField />

<asp:NextPreviousPagerField ButtonType="Image" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageImageUrl="/_layouts/1033/images/next.gif" LastPageImageUrl="/_layouts/1033/images/next.gif" NextPageImageUrl="/_layouts/1033/images/next.gif" PreviousPageImageUrl="/_layouts/1033/images/next.gif" />

</Fields>

</asp:DataPager>

No Responses to "How to style a table for Sharepoint"

Comment Form