Solved

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

Posted on 2011-02-25
2
1,307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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 to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

623 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