Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:33:17+00:00 2026-05-24T06:33:17+00:00

Hey I am trying to recreate the following HTML <table border=0 cellspacing=0 cellpadding=2 width=100%

  • 0

Hey I am trying to recreate the following HTML

<table border="0" cellspacing="0" cellpadding="2" width="100%" id="productListTable">
    <tr>
        <th rowspan="2">Product Name</th>
        <th rowspan="2" >Pack Size</th>
        <th rowspan="2" >Trade Price</th>

        <th colspan="2"  style="border:none;">Discount</th>
        <th rowspan="2" >Actual Price</th>
        <th rowspan="2">Stock</th>
        <th rowspan="2">Quantity</th>
    </tr>
    <tr class="sub">
        <th >PLC</th>

        <th >Total</th>
    </tr>

In my Gridview the first tr is no problem as this can just be standard header text in my columns but I am wondering how I can add this sub tr

<tr class="sub">
    <th >PLC</th>

    <th >Total</th>
</tr>

And also how to add this style, to my existing column

<th colspan="2"  style="border:none;">Discount</th>

Heres my gridview at the moment

<asp:GridView ID="productListTable" runat="server" DataSourceID="srcProductListPerCustomer" AutoGenerateColumns="False" AlternatingRowStyle-CssClass="tr_dark"  HeaderStyle-CssClass="header_req" BorderWidth="0px" GridLines="None" AllowPaging="true" PageSize="25" EmptyDataText="No records." AllowSorting="false" Width="100%" DataKeyNames="product_ID_key" OnRowDataBound="productListTable_RowDataBound" OnRowCommand="productListTable_RowCommand"  >         
    <Columns>                         
            <asp:TemplateField HeaderText="Product Name" HeaderStyle-Width="250px" SortExpression="productName" ItemStyle-CssClass="product_name" >
                <ItemTemplate>   
                <asp:Label ID="ProductNameField" runat="server" Text='<%# Eval("productName").ToString() %>'></asp:Label>
                </ItemTemplate>                     
            </asp:TemplateField> 

    </Columns>
    <Columns>                         
            <asp:TemplateField HeaderText="Pack Size" HeaderStyle-Width="70px" SortExpression="packSize">
                <ItemTemplate>  
                <asp:Label ID="PackSizeField" runat="server" Text='<%#  Eval("packSize").ToString()%>'></asp:Label>
                </ItemTemplate>                     
            </asp:TemplateField> 

    </Columns>
    <Columns>                         
            <asp:TemplateField HeaderText="Trade Price" HeaderStyle-Width="130px" SortExpression="address">
                <ItemTemplate>   
                <asp:Label ID="TradePriceField" runat="server" Text='<%#  DisplayMoney(Eval("tradePrice").ToString())%>'></asp:Label>
                <asp:Label ID="TradePriceFieldHidden" runat="server" Text='<%#  Eval("tradePrice").ToString()%>' Visible="false"></asp:Label>
                </ItemTemplate>                     
            </asp:TemplateField> 

    </Columns>
    <Columns>                         
            <asp:TemplateField HeaderText="Discount" HeaderStyle-Width="60px" SortExpression="discount">
                <ItemTemplate>   
                <asp:Label ID="DiscountField" runat="server" Text='<%# Eval("discount").ToString() + "%" %>'></asp:Label>
                </ItemTemplate>                     
            </asp:TemplateField> 

    </Columns>
    <Columns>                         
            <asp:TemplateField HeaderText="Actual Price" HeaderStyle-Width="130px" SortExpression="actualPrice">
                <ItemTemplate>   
                <asp:Label ID="ActualPriceField" runat="server" Text='<%#  DisplayMoney(Eval("actualPrice").ToString())%>'></asp:Label>
                </ItemTemplate>                     
            </asp:TemplateField> 

    </Columns>
    <Columns>                         
            <asp:TemplateField HeaderText="Stock" HeaderStyle-Width="130px" SortExpression="stock_indicator">
                <ItemTemplate>   
                <asp:Label ID="StockField" runat="server" Text='<%# DisplayStockLevel(Eval("stock_indicator").ToString()) %>'></asp:Label>
                </ItemTemplate>                     
            </asp:TemplateField> 

    </Columns>
     <Columns>  

    <asp:TemplateField HeaderText="Quantity">
                    <ItemTemplate>
                        <asp:TextBox runat="server" ID="txtQuantity" Columns="5"></asp:TextBox><br />
                        <asp:LinkButton runat="server" ID="btnRemove" Text="Remove" CommandName="Remove" CommandArgument='<%# Eval("product_ID_key") %>' style="font-size:12px;" Visible="false"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
    </Columns>
    <HeaderStyle CssClass="header_req" />
    <AlternatingRowStyle CssClass="tr_dark" />
    <PagerStyle CssClass="pagination" />
    <PagerSettings PageButtonCount="3" FirstPageText="First" LastPageText="Last" NextPageText="Next" PreviousPageText="Previous" Mode="NumericFirstLast" />      
</asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:33:19+00:00Added an answer on May 24, 2026 at 6:33 am

    I’m not sure about your current scenario, but it seems like you might want to take a look at the ListView control.

    Out of the box GridView tends to create a ton of extra HTML to get it to look right. I’m not sure you’ll ever be able to get exactly what you’re looking for that way.

    I did see that you have some paging stuff in there; if you go the ListView route, you’ll want to use a DataPager as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey everyone, I am trying to run the following program, but am getting a
Hey having some trouble trying to maintain transparency on a png when i create
Hey everyone. I'm trying to make a swing GUI with a button and a
Hey, I am trying to write a command to print todays date on the
Hey! I am not trying to push my luck here but I have another
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey trying to make a fancy little app here in VB.NET framework 4. I've
Hey im trying to display a modal view controller as soon as my tab
Hey im trying to use the WIPMania Geolocation database in my C# application but
Hey I'm trying to return a message when there are no results for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.