Max Frai
Max Frai

Reputation: 64266

Html and tables

I have such table: http://jsfiddle.net/jDTTx/

I can't understand how to split cell with text 1 into 2 horizontal cells. Could you help me with this?

Upvotes: 2

Views: 84

Answers (2)

Khan
Khan

Reputation: 18142

You will want to set the rowspan for all of the cells in the row above it to 2, and leave the row span for the two cells which you would like to appear split as 1.

See it in action: http://jsfiddle.net/jDTTx/6/

    <table border="1" style="border: 2px solid black; width: 50%; margin: 0 auto; text-align: center; font-weight: bold" cellpadding="0" cellspacing="0">
        <thead style="background-color: gray; color: white">
            <tr>
                <td>№</td>
                <td>Час</td>
                <td>АУД. 402</td>
                <td>АУД. 402<sup>A</sup></td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td rowspan="2">1</td>
                <td rowspan="2">8<sup><u>00</u></sup> - 9<sup><u>20</u></sup></td>
                <td>1a</td>
                <td rowspan="2"></td>
            </tr>
            <tr>
                <td>1b</td>
            </tr>
            <tr>
                <td>2</td>
                <td>9<sup><u>35</u></sup> - 10<sup><u>55</u></sup></td>
                <td>6</td>
                <td></td>
            </tr>
            <tr>
                <td>3</td>
                <td>11<sup><u>15</u></sup> - 12<sup><u>35</u></sup></td>
                <td></td>
                <td>7</td>
            </tr>
        </tbody>
    </table>​​​​​​​​​​​​​​​​​​

Upvotes: 2

SupremeDud
SupremeDud

Reputation: 1411

Place this in your cell:

<div style="border-bottom:solid 1px black">1a</div><div>1b</div>

http://jsfiddle.net/jDTTx/7/

Upvotes: 1

Related Questions