how do you set the font size in a table cell?

Posted on 2005-05-05
Last Modified: 2013-12-03
I'm trying to set a table cell to a font size of smaller, or small, etc.

I know for setting the font style or name I would go

Dim tCell as table cell = "arial"

how can I do the same for size???
Question by:shuittny
    LVL 18

    Expert Comment

    tCell.Font.Size = 123


    Author Comment

    i get a 'Integer can't be converted to 'System.Web.UI.WebControls.FontUnit' error message.

    LVL 18

    Accepted Solution

    In that case use this:

    tCell.Font.Size = FontUnit.Point(8)


    Author Comment

    right on!


    Expert Comment

    Very useful.  The Wrox book Professional ASP.NET shows an example (in VB.NET) as:

    tCell.Style("font-family") = "Tahoma"

    which did not work.

    tCell.font.whatever is exactly what I needed.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now