Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 554
  • Last Modified:

ASP.net table vs Excel cell size

Hi

I am trying to make the cells in my ASP.net table the same size as a standard Excel cell
using:
    tCell.Width = 48
    tCell.Height = 15
but the ASP.net table cell is bigger than an Excel cell size.
Does anyone know how to achieve this, in other words what proportion bigger an
ASP.net table cell is bigger than an Excel cell?
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
Bob LearnedCommented:
You have to understand how Excel uses widths:

Description of how column widths are determined in Excel
http://support.microsoft.com/kb/214123

Excel begins with a default width of 8 characters and translates this into a given number of pixels, depending on the Normal style font. It then rounds this number up to the nearest multiple of 8 pixels, so that scrolling across columns and rows is faster. The pixel width is stored internally in Excel for positioning data on the screen. The number that you see in the Column Width dialog box is the pixel width re-translated into character units (based on the Normal font) for display.

A column width of 8.43 means that 8.43 of the default font's characters fit into a cell. The default font for the worksheet is the font that is assigned to the Normal style. Excel 2000 uses a factory default font of Arial 10.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now