Solved

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

Posted on 2011-02-25
2
1,274 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

733 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