Solved

How to set font size in repeater control in ASP.Net?

Posted on 2011-02-25
2
1,219 Views
Last Modified: 2012-06-27
I am using CSS style sheet to style my repeater control. It is somehow not setting the font size. How can I set font size in my repeater control?
STYLE SHEET
-------------------
div.repeater
{
    width:auto;
    height:125px;
    overflow:scroll;
    font-size:12px;  
    font-weight:800;  
}
.reptable
{
    width : 100%;
    border : 1px solid #ffffff;
    background-color : #cccccc;
    font-size:12px;  
    font-weight:800;
}
.reptableheadercell
{
    border-bottom : 1px solid #ffffff;
    border-right : 1px solid #ffffff;
    background-color : #4B6C9E;
    color : #ffffff;
    font-size:12px;  
    font-weight:800;
}
.reptablehdrcell
{
    border-bottom : 1px solid #ffffff;
    border-right : 1px solid #ffffff;
    background-color : #4B6C9E;
    color : #ffffff;
    width:auto;
    font-size:12px;  
    font-weight:800;
}
.reptableheadercell td
{
    color : Black;
    padding-left : 5px;
    padding-right : 5px;
    font-size:12px;  
    font-weight:800;
}
.reptablerowcell1
{
    color : Black;
    border-bottom : 1px solid #ffffff;
    border-right : 1px solid #ffffff;
    background-color : #eeeeee;
    color : #000000;
    font-size:8px;  
    font-weight:800;
}
.reptablerowcell1 td
{
    color : #000000;
    padding-left : 5px;
    padding-right : 5px;
    font-size:8px;  
    font-weight:800;
}
.reptablerowcell2
{
    color : #000000;
    border-bottom : 1px solid #ffffff;
    border-right : 1px solid #ffffff;
    background-color : #cccccc;
    font-size:8px;  
    font-weight:800;
    }
.reptablerowcell2 td
{
    color : #000000;
    padding-left : 5px;
    padding-right : 5px;
    font-size:8px;  
    font-weight:800;
}

ASPX page
----------------
<div class="repeater">
      <asp:Repeater ID="rep" runat="server">
            <HeaderTemplate>
                     <table  width="100%" class="reptable">
                            <tr align="center" class="reptable">
                                <td class="reptableheadercell">column1</td>
                                <td class="reptableheadercell">column2</td>

                     </tr>  
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr align="center">
                        <td class="reptablerowcell1"><%# DataBinder.Eval(Container.DataItem, "column1")%>
                        </td>
                        <td class="reptablerowcell1"><%# DataBinder.Eval(Container.DataItem, "column2")%>
                        </td>
                        </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                        <tr align="center" class="reptablerowcell2">
                        <td class="reptablerowcell2 td"><%# DataBinder.Eval(Container.DataItem, "column1")%>
                        </td>
                        <td class="reptablerowcell2 td"><%# DataBinder.Eval(Container.DataItem, "column2")%>
                  </td>
                        </tr>
                        </AlternatingItemTemplate>
                        <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>  
            </div>
0
Comment
Question by:reach_prgmmer
2 Comments
 
LVL 4

Accepted Solution

by:
jmnf earned 500 total points
ID: 34984454
different font size for different child elements of the repeater? or

repeater *
{
    font-size: 12px;
    font: 12px Arial; /* just in case you need to override "font:" styling */
}
0
 

Author Closing Comment

by:reach_prgmmer
ID: 35010325
Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now