Setting column widths in DataList?

Discussion in 'ASP .Net' started by Rachel Devons, Jun 18, 2005.

  1. All,

    I have a table with three rows, and within each row I have a DataList that
    is set to use 3 columns. The problem I'm having is that each DataList sets
    it's columns to be different widths so when the user is looking at the data,
    the columns move back and forth among the DataLists. I don't know how well
    this will appear in text, but it looks something like:

    XXX XXXXX XXXXX
    XXX XXXX XXXXX
    XXX XXXXX XXXX

    Where it should look like:
    XXX XXXXX XXXXX
    XXX XXXXX XXXXX
    XXX XXXXX XXXXX

    What I need is to be able to tell each DataList to make it's columns a fixed
    width so that all three datalist have the same column sizes. I can't put all
    of the data into a single datalist because I need to have a unique header
    above each datalist.

    Is this possible? Or am I going about this the wrong way?

    Thanks for any info!
     
    Rachel Devons, Jun 18, 2005
    #1
    1. Advertisements

  2. There is no way to force the browser to show 3 different tables with the
    same column width. You don't have full control over column widths, the
    browser considers your instructions as recommendations. You have to put all
    the datalists inside the same table and solve the header problem. You might
    want to merge 3 datasources in 1 with header records in between, then in
    ItemDataBound event catch the header records and format them differently.

    Eliyahu
     
    Eliyahu Goldin, Jun 19, 2005
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.