Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5955811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:10:00+00:00 2026-05-22T18:10:00+00:00

Okay this is embarrassing. I’m almost tempted to use TABLE but I think it’s

  • 0

Okay this is embarrassing. I’m almost tempted to use TABLE but I think it’s wrong.

Basically, I have a page with a fieldset, that in “Edit Mode” has a bunch of inputs like so:

<label for="txtName">Address</label>
<textarea name="Name" id="txtName">
    1 The test
    AddressTown
    UK
</textarea>

When this page is in “Read Only” mode, the textarea turns into a span e.g

<label>Address</label>
<span>
    1 The test<br />
    AddressTown<br />
    UK
</span>  

I want to lay the label and value out in a tabular way so that each label is on the left with a fixed width and the input or span follows it like so:

---------------------------
Name       1 the test
           AddressTown
           UK
---------------------------

This would be a no-brainer in a TABLE:

<table>
<tr>
    <th style="width: 150px; vertical-align: top;">
        <label>Address</label>
    </th>
    <td>
        <span>
        1 The test<br />
        AddressTown<br />
        UK
        </span>
    </td>
</table>

However I have been trying to achieve this with CSS, using float on just the label and on both, but no matter what I try, I’m in one of the following scenarios:

  • The second line of the span wraps below the label
  • The span starts directly beneath the label
  • I get a nice tabular layout BUT I have to specify the width of the span, which I don’t want to do.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:10:01+00:00Added an answer on May 22, 2026 at 6:10 pm

    As per my comment above there is nothing wrong with using tables for a tabular layout! If however you really don’t want to use tables, you can set the span to display: block and give it a margin.

    <!DOCTYPE html>
    <html>
        <label>Address</label>
        <span>
            1 The test<br />
            AddressTown<br />
            UK
        </span>
    
        <style>
            label { float: left; width: 200px; }
            span { margin-left: 200px; display: block; }
        </style> 
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this may be a simple question but I have yet to come with
Okay this is probably a rookie question, but I have never done GUI programming
Okay this may sound a bit weird but it is what I have to
Okay - this is the dumbest glitch I have seen in a while: <!DOCTYPE
Okay this is very hard to explain, but i want to add padding to
okay so this is probably a soft pitch question for sombody, but I want
Okay so this is a bit complex but I need to loop through this
Okay this one may be a bit out from left field, but I'm going
Okay this one's pretty straightforward. I'm creating a checkbox in my Page.xaml.cs file, and
Okay this is frustrating me to no end. I recently coded a page in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.