Spacing columns in DataGrid

Discussion in 'ASP .Net' started by Greg Linwood, Dec 18, 2003.

  1. Greg Linwood

    Greg Linwood Guest

    I'm using a Data Grid and want to apply wider spacing between columns than
    rows. As such, cellspacing / padding aren't any use to me.

    I used to do this in html tables by simply adding columns with a single
    point transparent .gif, set to a specific .pt width. This worked very well
    for precise alignment.

    I can't find an easy way to do this using a DataGrid. It is possible for me
    to add columns (I'm doing this at run-time) but the darned thing requires me
    to give a UNIQUE NAME to these columns which is really peeving me because
    the columns have no other purpose but spacing. There's nothing unique to
    name about them. What's worse, it displays the Column name in the header
    row, which limits me to naming the columns with progressively longer strings
    of blank strings, just to get a unique column name that won't display
    anything when the table is rendered.. :c/

    Surely there's a better way to do this!!

    I'd appreciate any suggestions.

    Regards,
    Greg Linwood
    SQL Server MVP
    Greg Linwood, Dec 18, 2003
    #1
    1. Advertising

  2. Greg Linwood

    Natty Gur Guest

    Hi,

    What about css that will change border-right-width and border-left-width
    style attribute.

    Natty Gur[MVP]

    blog : http://weblogs.asp.net/ngur
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Dec 18, 2003
    #2
    1. Advertising

  3. Greg Linwood

    Greg Linwood Guest

    Thanks Natty - I'll check this option out today.

    Regards,
    Greg Linwood
    SQL Server MVP

    "Natty Gur" <> wrote in message
    news:...
    > Hi,
    >
    > What about css that will change border-right-width and border-left-width
    > style attribute.
    >
    > Natty Gur[MVP]
    >
    > blog : http://weblogs.asp.net/ngur
    > Mobile: +972-(0)58-888377
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Greg Linwood, Dec 19, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Terry Olsen

    Datagrid Cell Spacing Wierdness

    Terry Olsen, Mar 28, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    548
    Terry Olsen
    Mar 29, 2005
  2. rob thomson
    Replies:
    0
    Views:
    254
    rob thomson
    Sep 4, 2003
  3. Mike Smith

    Datagrid spacing

    Mike Smith, Oct 7, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    97
    Mike Smith
    Oct 7, 2003
  4. ton
    Replies:
    2
    Views:
    200
    Alvin Bruney [MVP]
    Feb 11, 2004
  5. Justin To

    Spacing data into columns

    Justin To, Jun 23, 2008, in forum: Ruby
    Replies:
    3
    Views:
    86
    Robert Klemme
    Jun 24, 2008
Loading...

Share This Page