views:

442

answers:

1

The below code does what I want in browsers I check with except IE when using compatibility mode. In compatibility mode the submit (Remove) button wraps to the next line. Can anyone help? It should look like it does in Firefox or IE when not using compatibility mode. Can't use float:left/right because I cannot specify length beforehand.

Thanks for any help.


<div>
    <ul style="display:inline-table">
        <li style="text-align:left; white-space:nowrap">
            <div>
                <div style="display:table-cell; width:100%"><b>Name: </b>Test Name That is Longer Than The Other <b>Qty: </b>1</div>
                <div style="display:table-cell">
                    <form style="margin:0; padding:0" name="remcart" method="post" action="page_name.html">
                    <input name="Quantity" value="0" type="hidden" />
                    <input style="margin:0; padding:0; margin-left:5px" type="submit" value="Remove" name="rembutton" />
                    </form>
                </div>
            </div>
        </li>
        <li style="text-align:left; white-space:nowrap">
            <div>
                <div style="display:table-cell; width:100%"><b>Name: </b>Short Test Name <b>Qty: </b>1</div>
                <div style="display:table-cell">
                    <form style="margin:0; padding:0" name="remcart" method="post" action="page_name.html">
                    <input name="Quantity" value="0" type="hidden" />
                    <input style="margin:0; padding:0; margin-left:5px" type="submit" value="Remove" name="rembutton" />
                    </form>
                </div>
            </div>
        </li>
    </ul>
</div>
A: 
<style>
    form {
        display: inline;
    }
</style>

<ul style="display:inline-table">
    <li style="text-align:left; white-space:nowrap">
        <div>
            <span><b>Name: </b>Test Name That is Longer Than The Other <b>Qty: </b>1</span>
            <form style="margin:0; padding:0" name="remcart" method="post" action="page_name.html">
            <input name="Quantity" value="0" type="hidden" />
            <input style="margin:0; padding:0; margin-left:5px" type="submit" value="Remove" name="rembutton" />
            </form>
        </div>
    </li>
    <li style="text-align:left; white-space:nowrap">
        <div>
            <span><b>Name: </b>Test Name That is Longer Than The Other <b>Qty: </b>1</span>
            <form style="margin:0; padding:0" name="remcart" method="post" action="page_name.html">
            <input name="Quantity" value="0" type="hidden" />
            <input style="margin:0; padding:0; margin-left:5px" type="submit" value="Remove" name="rembutton" />
            </form>
        </div>
    </li>    
</ul>
Leo
Thank you for your response. Your solution works in that the buttons no longer wrap, but I forgot to add that I want the Submit (remove) buttons to line up on the right. Otherwise, I would have just floated everything left. Sorry this is such a pain.
Robert