Doc Holiday
Doc Holiday

Reputation: 10254

Need help aligning tables ...HTML

This should be an easy one. Just so you know, I normally write java logic, so styling is not my cup of tea, but got to do it. Anyway I just got this:

enter image description here

Im trying to get the tables to be side by side instead of on top of each other like this: enter image description here

Here's the HTML... thanks for your help.... Let me know if you need to see more code

<tr><tr><tr><tr><tr><tr>
    <table class="link_table">
        <tr>
            <td>
                <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
            </td>
        </tr>   
    </table>

    <table class="link_table">
        <tr>
            <td>
                <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
            </td>
        </tr>
    </table>

Upvotes: 0

Views: 106

Answers (6)

Doozer Blake
Doozer Blake

Reputation: 7797

People are going to tell you not to use tables, and they'd be right. That said, you just need these two items in table cells in the same row:

<table class="link_table">
    <tr>
        <td>
            <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
        </td>
        <td>
            <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
        </td>
    </tr>
</table>

Upvotes: 2

IAmGroot
IAmGroot

Reputation: 13855

Add them to cells (td), Not seperate tables. :)

<table class="link_table">
    <tr>
        <td>
            <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
        </td>
        <td>
            <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
        </td>
    </tr>
</table>

Upvotes: 1

Isgrimur
Isgrimur

Reputation: 1

The table element works as a block-level element. A block-level element creates a linebreak. To modify the behavior use the CSS property "display":

.link_table{ float:left; }

That's not a pretty solution, but it works. Everything else involves more reading about HTML and CSS.

Cheers

Upvotes: 0

Tariqulazam
Tariqulazam

Reputation: 4585

Try this

<table class="link_table">
    <tr>
        <td>
            <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
        </td>
        <td>
            <a href="show.addEdit_hotpart?hotPartId=0">ADD HOT PART</a>
        </td>
    </tr>
</table>

Upvotes: 0

col
col

Reputation: 397

It is not good practice to use tables for layout, but if you absolutely have to do it then you could use the following css on your table element in this case:

style="display: inline;"

Upvotes: 1

Royi Namir
Royi Namir

Reputation: 148524

 <table class="link_table" style="display:inline">

Upvotes: 1

Related Questions