473,386 Members | 1,785 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 horizonal cell spacing/padding

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 space between the rows.

Thanks,
Greg
Sep 7 '07 #1
2 29495
Greg,
Try the CssClass attribute in ItemStyle for each column you want to format.

<asp:BoundField DataField="request_id" HeaderText="request_id">
<ItemStyle CssClass="col" />
</asp:BoundField>

cssclass:
..col
{
padding-right:10px;
padding-left:50px;
}

HTH,
Rakesh

"Greg" wrote:
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 space between the rows.

Thanks,
Greg
Sep 7 '07 #2
Excellent, that's just what I was trying to do! Thanks so much!

Greg
"Rak" wrote:
Greg,
Try the CssClass attribute in ItemStyle for each column you want to format.

<asp:BoundField DataField="request_id" HeaderText="request_id">
<ItemStyle CssClass="col" />
</asp:BoundField>

cssclass:
.col
{
padding-right:10px;
padding-left:50px;
}

HTH,
Rakesh

"Greg" wrote:
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 space between the rows.

Thanks,
Greg
Sep 7 '07 #3

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

Similar topics

1
by: Brian Tremblay | last post by:
An artist has a catalogue of her work in 3 tables, url < http://www.julietremblay.com/test/portfolio/catalogue.html > (valid html 4.01 strict) She wants the table head to be white on blue, and...
1
by: delerious | last post by:
Could someone please take a look at this page: http://home.comcast.net/~delerious1/index11.html The set of links on the left should not have any whitespace between them, and the set of links...
1
by: Andrew Poulos | last post by:
I'm trying to build a table using DOM methods with script that follows this type of format: // note the var bodyEl is predefined as the body element // var mytable =...
7
by: Ryan | last post by:
I am not a web programmer and trying to figure out the best way for laying out a form for data entry. I would like, for example, to have a right justified label followed by 5 pixals and a left...
2
by: Terry Olsen | last post by:
I'm using a Datagrid to display my data. I want to increase the cell spacing of the grid, but when I do, if a cell is empty, there is no border drawn for that cell. I tried just entering a 'space'...
1
by: Jon S via DotNetMonster.com | last post by:
HI all, I'm returning a dataset to a gridview control. When the gridview asp.net control is populated from the returning dataset some of the cells remain empty. This is expected as some data...
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: tfsmag | last post by:
I'm having a weird problem with the rowdatabound event for a gridview in my application... Here is the code. -------------------------------------- Protected Sub AnswersGrid_RowDataBound(ByVal...
2
by: bbaamm | last post by:
we are working in grid view in one grid each cell have childgrids and that child grid each cell contains 7 colmns and that 7 columns bind data from database but the cell spacing is not equal. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.