• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • Last Modified:

Datalist question

I am working with the following datalist and it's giving me a problem.  

    <asp:Datalist ID="dlBB" align="center" Width="95%" OnItemCreated="DataList_ItemCreated" runat="server">
            <table class="bordered" cellpadding="2" cellspacing="0" width="100%">
            <tr class="header_row">
                <th colspan="3" class="h_12">Blackberry</th>
            <tr class="subheader_row">
                <th class="b_9" width="250">Device Count</th>
                <th class="b_9" colspan="2">Hierarchy</th>
            <tr onmouseover="style.backgroundColor='#FFFFCC'" onmouseout="style.backgroundColor=''">
                <td class="r_10" width="100"><%# Container.Dataitem("DeviceCount")%>&nbsp;</td>
                <td class="r_10" colspan="2"><%#CommonFunctions.CommonFunctions.GetHierarchy(Container.DataItem("Hierarchy"))%>&nbsp;</td>
                  <asp:Label ID="lblBBTotal" CssClass="b_10" runat="server" />
              <td colspan="2" align="right">
                <a class="reglink" href="HierarchyReport.aspx?vendor=<%=lblVendor.text%>&action=HierarchyReportBB" target="_blank">Download Excel Report</a>

For whatever reason, it's putting an extra <td> tag around the <itemtemplate>, like such:
            --contents of the item template
                <td class="r_10" width="100">1&nbsp;</td>
                <td class="r_10" colspan="2">F - TS & F&nbsp;</td>

It's screwing up my css and driving me nuts.  Any thoughts?


1 Solution
In what way is it messing with your CSS?
stretch73Author Commented:
It's making the border double as thick as it is supposed to be
Is the cellpadding="2" causing it?
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

stretch73Author Commented:
Changing the cellpadding didn't change anything.  I think it's something to do with the way the Datalist generates HTML.  I changed one of the datalists to a repeater control and it worked fine.
stretch73Author Commented:
In the interest of time, I just changed all of the datalists to repeater controls which seems to have fixed the problem.  Apparently it renders HTML differently which is why I was getting extra tags.
Question closed - 250 points refunded.

Best regards,
Experts Exchange
Community Support Moderator

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