jamesmargolis Posted November 19, 2014 Share Posted November 19, 2014 I wish to display a text field with two buttons under it, and I want one of the button on the leftmost part (that’s very easy because that's the default), and the other on the rightmost part (this I don’t really know how to implement this). I am currently using something like this : <!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <fieldset> <input name="words" type="text" id="words" size="60" /><br><br> <input type="button" id="lb" name="leftbutton" value="leftbutton" /> <input type="button" id="rb" name="rightbutton" value="rightbutton" /> </fieldset> </body> </html> With this kind of code, I can adjust the number of to make the other button fit on the far right,but that’s obviously not the right way to do things. Perhaps I should use a table ? How ? Quote Link to comment https://forums.phpfreaks.com/topic/292565-how-to-right-align-data-in-a/ Share on other sites More sharing options...
bsmither Posted November 19, 2014 Share Posted November 19, 2014 A <table> will work, but I prefer to use style="float:right;". I recommend always coding the floated nodes as first in the group of nodes so that the floated node will be at the top of its container. <fieldset> <input name="words" type="text" id="words" size="60" /><br><br> <input type="button" id="rb" name="rightbutton" value="rightbutton" style="float:right;" /> <input type="button" id="lb" name="leftbutton" value="leftbutton" /> </fieldset> Quote Link to comment https://forums.phpfreaks.com/topic/292565-how-to-right-align-data-in-a/#findComment-1497010 Share on other sites More sharing options...
jamesmargolis Posted November 20, 2014 Author Share Posted November 20, 2014 A <table> will work, but I prefer to use style="float:right;". I recommend always coding the floated nodes as first in the group of nodes so that the floated node will be at the top of its container. <fieldset> <input name="words" type="text" id="words" size="60" /><br><br> <input type="button" id="rb" name="rightbutton" value="rightbutton" style="float:right;" /> <input type="button" id="lb" name="leftbutton" value="leftbutton" /> </fieldset> It works. Thanks! There is no way to mark a topic as solved in this forum ? Quote Link to comment https://forums.phpfreaks.com/topic/292565-how-to-right-align-data-in-a/#findComment-1497060 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.