logger
logger

Reputation: 2053

Skipping rows in HTML Table

I am trying to create HTML tables with desired result of

|----HTML PAGE----------------------|
|                                   |
|  ---Table-------------------------|
|  |   T     | Text      | Text     |
|  |   E     |----------------------|
|  |   X     | Image     | Image    |
|  |   T     |----------------------|
|  |         | Text      | Text     |
|  |         |-----------------------
|  |         | Image     | Image    |
|  |---------|-----------------------

But my the table isn't skipping the rows when I tried to add <td> before the text column. How do I skip column without adding rows or how do I make my table only display on the right side of the page?

<div>
    <table border="1" width="100%">
        <tbody>
            <tr>
                <td>Description</td>
            <tr>
                <th>MATH</th>
                <th>SCIENC</th>
            </tr>
            <tr>
                <td>
                    <form action="/" method="post">
                        <input type="image"src="<%=request.getContextPath()%>/css/categories/math.jpg">
                    </form>
                </td>
                <td>
                    <form action="/" method="post">
                        <input type="image" src="<%=request.getContextPath()%>/css/categories/science.jpg">
                    </form>
                </td>
                </tr>
            <tr>
                <th>PHYSIC</th>
                <th>ART</th>
            </tr>
            <tr>
                <td>
                    <form action="/" method="post">
                        <input type="image"src="<%=request.getContextPath()%>/css/categories/physic.jpg">
                    </form>
                </td>
                <td>
                    <form action="/" method="post">
                        <input type="image" src  <%=request.getContextPath()%>/css/categories/art.jpg">
                    </form>
                </td>
            </tr>
            </td>
            </tr>
            </tbody>
        </table>
    </div>

Upvotes: 0

Views: 2684

Answers (2)

Torge
Torge

Reputation: 2284

You can use the rowspan attribute: http://www.w3schools.com/tags/att_td_rowspan.asp

Upvotes: 0

Jackson
Jackson

Reputation: 149

Use rowspan property.

<table>
<tr>
    <td ROWSPAN=4> table data 1</td>
    <td> text</td>
    <td> image</td>
</tr>
<tr>
    <td> text</td>
    <td> image</td>
</tr>
<tr>
    <td > text</td>
    <td> image</td>
</tr>
    <tr>
    <td> text</td>
    <td > image</td>
</tr>

check this jsfiddle

Upvotes: 1

Related Questions