2015-02-23 49 views
0

并按中心对齐?HTML表格如何拆分第二列中的行?

对我来说,我需要的是这样的:在地方

enter image description here

其中方是,我想把图片,在中心对齐。我尝试做表,但我可以这样拆分仅第一行:

<div> 
    <asp:Panel> 

     <table> 
     <tr> 
     <td rowspan="2" bgcolor="#FBF0DB">Cell 1</td> 
     <td>Cell 2</td> 
     </tr> 
     <tr> 
     <td>Cell 3</td> 
     </tr> 
     </table> 

    <!-- here other markup --> 
    </asp:Panel> 
</div> 

enter image description here

但是,如果我换(从第二首TR TD),右细胞不分裂或

enter image description here

如何从右侧分裂和中心对齐:不居中对齐?

回答

1

只要做这样的事情,你会没事的。

<div> 
<asp:Panel> 

    <table> 
    <tr> 
    <td bgcolor="#FBF0DB">Cell 1</td> 
    <td rowspan="2">Cell 2</td> 
    </tr> 
    <tr> 
    <td >Cell 3</td> 
    </tr> 
    </table> 

<!-- here other markup --> 
</asp:Panel> 

原理只是告诉第一行第二列,取代默认的是一个占据两行。

+0

是的谢谢!编辑后它工作:) – 2015-02-23 21:14:42

+0

不错,我的荣幸。 – 2015-02-23 21:18:24

相关问题