Steffan Harris
Steffan Harris

Reputation: 9326

Aligning Items in tables

Ok, I have this table. The problem is that I want the X to appear in the same position that it is in the first cell. How would I go about doing something like that. Here is my code.

<html>
    <body>
        <table border="1">
            <tr>
                <tr>
                    <td>
                        Helllllllllllllllooo&nbsp;&nbsp;
                        <span>X</span>
                    </td>
                </tr>
                <tr>
                    <td>
                        1&nbsp;&nbsp;
                        <span>X</span>
                    </td>
                </tr>
                <tr>
                    <td>
                        2&nbsp;&nbsp;
                        <span>X</span>
                    </td>
                </tr>
                <tr>
                    <td>
                        3&nbsp;&nbsp;
                        <span>X</span>
                    </td>
                </tr>
        </table>

    </body>
</html>

Upvotes: 0

Views: 69

Answers (2)

Quentin
Quentin

Reputation: 943250

It is difficult to tell since you haven't provided us with real data, but if the position is importent then there is a good chance that it is conveying data that is best expressed as a separate cell.

<tr>
    <td>
        Helllllllllllllllooo&nbsp;&nbsp;
    </td>
    <td>
        X
    </td>
</tr>

Upvotes: 0

ptriek
ptriek

Reputation: 9276

What about

td span { float:right; }

?

Upvotes: 1

Related Questions