Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Tables and ASP.NET

Status
Not open for further replies.

JerryLan

Programmer
Jan 26, 2005
27
US
I see alot of talk these days about people bragging that through the use of CSS they have created complicated Web Forms which do not use any <table></table> tags. Does anyone have a link to a tutorial on how to accomplish this?
I need to create user input forms which look similar to this:

User
Name _______________ Address ________________
Fav
Beer ________________ 2nd Fav ________________

User
Explanation _____________________________________


The challenge is as you can see that the top 2 lines and the bottom line do not have columns which line up. If this were a single table the colums would automatically use the largest contents to make the width of the columns.
How is this done in CSS?
 
Thanks Vragabond
As I am implementing your suggested ideas I have run into a mystery.
My style sheet applies to the page and correctly styles the text font and size. It also correctly styles the width of the label (I want the text to wrap).
The problem is If I say:
<label>Customer Name</label>
and let the stylesheet for label work it centers the text in the label and ignores that style element. If I say:
<label style="TEXT-ALIGN: left">Customer Name</label>
It correctly left aligns the text. Why is the CSS code for "label" not working?

Here is the code snippet:
<form id="Form1" method="post" runat="server">
<label>Customer Name</label>
</form>
And here is the CSS:
body
{
font-size: medium;
font-family: Verdana, Arial, 'Book Antiqua';
}
label
{
text-align:left;
width: 20px;
height: 43px;

}
 
I refreshed the browser and it started working. Go figure. I didn't see a function for recalling posts.
[sleeping2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top