Struggling Developer Struggling Developer - 1 month ago 6
HTML Question

How to create a cell using rowspan and colspan in a table

I have two rows and two columns in my table i have do the following using rowspan and colspan. There will be one cell on the corner. Please check the fiddle. I want to create below using table.

http://jsfiddle.net/UvjwJ/

I have to create it using table:-

<table>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>


How can I do this. I have to do this using table not div or removing the border of td.
I dont have any idea to do that. I have tried to find this question in google but I can't find any.

Answer

this is the only way you could achive what you want using only tables: http://jsfiddle.net/ZeVjU/ . It uses multiple tables and align (and it will work on all browsers, rowspan doesn't work in all browsers).

Moreover, keep in mind that a table cell needs to be a rectangle. You can not have other kind of cells.

<table width="200" border="1" cellpadding="2">
<tr>
    <td>
        <table border="1" align="right">
            <tr>
                <td>asdadasd</td>
            </tr>
        </table>
        asdasdasdas das das das das dasdasd as dasd asd asdas dasd asd asd as dasdas dasd a
    </td>
</tr>
</table>