Click here to Skip to main content
12,359,102 members (34,708 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
I want to merge table cells because i want to display the heading of the table is nearly together how to do it in asp.net

Please help

Thanks in advance

Happy Christmas and Happy New year all of you
Posted 25-Dec-11 21:59pm
devausha1.5K
Comments
Uma Shankar Patel 26-Dec-11 4:03am
   
same to you.......
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

hi frnd,

you can use below example for merge 2 cell:

For HTML

<table>
     <tr>
        <td colspan="2">
        merge Cell Display header here
        </td>
     </tr>
     <tr>
       <td>Cell 1</td>
       <td> Cell2</td>
     </tr>
   </table>

ColSpan: if you want to merge N Cells then Colspan Attribute value = N ie. for merge 10 cells, ColSpan attribute value = 10.

For ASP.net Table Control

<asp:table runat="server" xmlns:asp="#unknown">
    <asp:tablerow>
       <asp:tablecell columnspan="2">
 
         Merge cell : display Header here
       </asp:tablecell>
    </asp:tablerow>
    <asp:tablerow>
      <asp:tablecell>Cell1</asp:tablecell>
      <asp:tablecell>Cell2</asp:tablecell>
    </asp:tablerow>
  </asp:table>

here we have ColumnSpan attribute for merge the cells
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Uses rowspan tag, you can do it.and You can try this url....................http://www.hscripts.com/tutorials/html/rowspan.php[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

<table>
     <tr>
        <td colspan="2">
        merge Cell Display header here
        </td>
     </tr>
     <tr>
       <td>Cell 1</td>
       <td> Cell2</td>
     </tr>
   </table>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 23 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100