Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a table look like this?

Tags:

html

css

Can a table look like this be made?

+---------------+
|   |   |   |   |
+---------------+
|     |   |     |
+---------------+
|   |   |   |   |
+---------------+

If I do

<table>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
    </tr>
    <tr><td>
        <table>
            <tr>
                <td>a</td>
                <td>b</td>
                <td>c</td>
            </tr>
        </table>
        </td></tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
    </tr>
</table>

then abc is inserted in just one <td>.

This jdfiddle shows the problem

http://jsfiddle.net/littlesandra88/EskrV/

How is such a table made, if it is possible?

like image 438
Sandra Schlichting Avatar asked Nov 30 '22 08:11

Sandra Schlichting


2 Answers

Add a colspan to the <td> with the 3 column table.

Updated fiddle: http://jsfiddle.net/EskrV/18/

<table>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
    </tr>
    <tr><td colspan="4">
        <table>
            <tr>
                <td>a</td>
                <td>b</td>
                <td>c</td>
            </tr>
        </table>
        </td></tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
    </tr>
</table>
like image 119
Michael Irigoyen Avatar answered Dec 11 '22 01:12

Michael Irigoyen


You could do

<table>
    <tr>
        <td colspan=3>1</td>
        <td colspan=3>2</td>
        <td colspan=3>3</td>
        <td colspan=3>4</td>
    </tr>
    <tr>
        <td colspan=4>a</td>
        <td colspan=4>b</td>
        <td colspan=4>c</td>
    <tr>
        <td colspan=3>1</td>
        <td colspan=3>2</td>
        <td colspan=3>3</td>
        <td colspan=3>4</td>
    </tr>
</table>
like image 36
murgatroid99 Avatar answered Dec 11 '22 01:12

murgatroid99