Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-02-25
2
Medium Priority
?
1,359 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 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
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…

715 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