如何在表控件中合并表格单元格 [英] How to merge table cells in table control

查看:109
本文介绍了如何在表控件中合并表格单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想合并表格单元格,因为我想显示表格的标题几乎是在一起如何在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

推荐答案

嗨frnd,



您可以使用以下示例进行合并2单元格:



对于HTML



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:如果你想合并N Cells然后Colspan属性值= N ie。对于合并10个单元格,ColSpan属性值= 10.



对于ASP.net表控件





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>





这里我们有 ColumnSpan 属性用于合并单元格


使用行间距和hsp的colspan


使用rowspan标签,你可以做。你可以尝试这个网址.................... http://www.hscripts.com/tutorials/html/rowspan.php [ ^ ]
Uses rowspan tag, you can do it.and You can try this url....................http://www.hscripts.com/tutorials/html/rowspan.php[^]


这篇关于如何在表控件中合并表格单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆