Link to home
Start Free TrialLog in
Avatar of riceman0
riceman0

asked on

How do I right-align a WebForm textbox


How do I make it so a webform textbox (or some other control) is always aligned with the right side of the browser (if the user resizes)?
Avatar of Swapnil
Swapnil
Flag of India image

Hi riceman0,
Put the control in the table and set the align property of table cell to "right".
like
<table>
    <tr>
        <td align="right">
            <asp:textbox id = "txttest"....>
        </td>
    </tr>
</table>

Cheers!
NetSwap
Avatar of riceman0
riceman0

ASKER


I don't think I can put a webform textbox in an HTML table, can I?
I'm referring to the webform textbox in the control toolbox.  Doesn't seem I can drag and drop it into my HTML table in design view.  And I really don't know how to write the code to create one in HTML.
ASKER CERTIFIED SOLUTION
Avatar of Swapnil
Swapnil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Is a table the only way to align things?
Yes because your form may be minimize, maximize or resize basis on that it is difficult to maintain position of the control in any other way.