473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

GridView cell padding as percentage?

Is there any way to set CellPadding for a GridView to a percentage, as
you can for a plain HTML table, rather than a fixed pixel amount?

Dec 19 '06 #1
2 2058
Not with the CellPadding parameter.

You can see the effect of the CellPadding setting in the html source for the
page and try to reproduce the same effect with css classes or attributes.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Ira Gladnick" <Ir*********@yahoo.comwrote in message
news:11*********************@f1g2000cwa.googlegrou ps.com...
Is there any way to set CellPadding for a GridView to a percentage, as
you can for a plain HTML table, rather than a fixed pixel amount?

Dec 19 '06 #2
Try ... gridview1.Attributes.Add("CellPadding ", "100%");

Eliyahu Goldin wrote:
Not with the CellPadding parameter.

You can see the effect of the CellPadding setting in the html source for the
page and try to reproduce the same effect with css classes or attributes.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Ira Gladnick" <Ir*********@yahoo.comwrote in message
news:11*********************@f1g2000cwa.googlegrou ps.com...
Is there any way to set CellPadding for a GridView to a percentage, as
you can for a plain HTML table, rather than a fixed pixel amount?
Dec 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style>...
3
by: Thomas Mlynarczyk | last post by:
Hello, How can I make an <a> element (containing text only, styled to be a box with a border) as big as the table cell in which it resides, *without* having specified any width/height (neither...
4
by: Robert | last post by:
Hi, I am trying to add a background to a cell that contains multiple horizontal coloured layers on top of eachother. I managed to do this in IE, but firefox displays something very different...
3
by: washoetech | last post by:
I have a gridview control. In this grid view there is a column for the price of an item. Some of the prices have a dollar sign in front of it and some dont. How do I get rid of the dollar sign...
0
by: Dabbler | last post by:
I need more space between my columns but increasing cellpadding increases vertical spacing and the gridview flows below "the fold". Is there some way to increase only horizontal padding? I tried...
0
by: Innova | last post by:
Hi, We are working on a gridview inside the gridview (parent-child) scenario. The data of child grid will depend on the data of parent. Objectives: 1.Add new row in parent grid after each row...
1
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the right column in my GridView. The GridView consist of 2 columns, the problem column is the column on the right side. The problem is that it looks like...
6
by: =?Utf-8?B?TWlrZSBQYXJyaXM=?= | last post by:
I am trying to set the width of one of the columns of an asp.net 2.0 Gridview control. I am using a line - MyGridview.Columns.ItemStyle.Width = Unit.Percentage(40); The problem is that there...
2
by: =?Utf-8?B?R3JlZw==?= | last post by:
Is there a way to set the horizontal cell spacing or padding of a gridview without setting the vertical spacing/padding? I'd like to be able to put some space between the columns without putting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.