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

  • Home
  • SEARCH
  • 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 7527593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:08:40+00:00 2026-05-30T04:08:40+00:00

Given the following code, how do I left align the table without using float:left

  • 0

Given the following code, how do I left align the table without using float:left? I thought applying text-align:left to the parent element of the table would do the job, but it doesn’t.

http://jsfiddle.net/william/B4qJG/1

HTML:

<div class="valueList">
 <div class="valuePair">
   <label>Assets</label>

  <div>
    <div>
      <div class="dataTables_wrapper">
        <table cellspacing="0" style="border-collapse:collapse;" class="display">
          <thead>
            <tr>
              <th scope="col" class="sorting_asc" style="width: 406px;">Name</th>

              <th scope="col" class="sorting" style="width: 440px;">AssetNumber</th>

              <th scope="col" class="sorting" style="width: 305px;">Action</th>
            </tr>
          </thead>

          <tbody>
            <tr class="odd">
              <td class=" sorting_1">Chair</td>
              <td>2323424</td>
              <td><a href="#">Remove</a></td>
            </tr>

            <tr class="even">
              <td class=" sorting_1">Table</td>
              <td>34345345</td>
              <td><a href="#">Remove</a></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div><input type="button" value="Add Asset" />
  </div>

  <div class="clear"></div>
</div>
</div>

CSS:

.valueList
{
    width: 100%;
    text-align: left;
}

    .valueList .valuePair
    {
        width: 100%;
        padding: 0.3em 0;
        border-top: 1px #eee solid;
    }

    .valueList .valuePair *
    {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        -webkit-box-sizing:border-box;
    }

    .valueList .valuePair:first-child
    {
        border-top: 0;
    }

        .valueList .valuePair > div, .valueList .valuePair > label
        {
            float: left;
            padding: 0.3em 0;
            line-height: 2em;
            border: 1px solid transparent;
        }

        .valueList .valuePair > *:first-child
        {
            width: 20%;
            /*margin-right: 1%;*/
            padding-right: 1%;
            font-weight: bold;
        }

        .valueList .valuePair > * + div
        {
            width: 75%;
            border-color: white;
            padding-left: 1%;
        }

        .valueList .valuePair > div.clear
        {
            padding: 0;
            border: 0;
            height:0;
        }

            .valueList .valuePair > * + div > input[type=text],
            .valueList .valuePair > * + div > textarea
            ,.valueList .valuePair > * + div > select
            {
                width: 100%;
                max-width: 350px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    -webkit-box-sizing:border-box;
            }
            .valueList .valuePair > * + div > input[type=radio],.valueList .valuePair > * + div > input[type=checkbox]
            {
                width: auto;
            }


table.display {
    width: 60%;
}

.dataTables_wrapper {
    text-align: left;
}
  • 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-30T04:08:41+00:00Added an answer on May 30, 2026 at 4:08 am
    table.display {
        width: 60%;
        margin: 0;  /* <- works for me this way ****/
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following html: <table> <tr> <td> <img rel=20110914103319-9589184176 src=images/redXblackBackground.png style=float: left;> </td> </tr>
Given the following code: using (var client = new WebClient()) { string url =
Given the Following Code how Would i Change/Set my Silverlight WCF Service URI in
Given the following code: <div id='upperDiv' style='min-height:200px'> <div id='rightDiv' style='float:right; width:75%'> content1 </div> <div
Given the following code (that doesn't work): while True: # Snip: print out current
Given the following code snippet from inside a method; NSBezierPath * tempPath = [NSBezierPath
given the following code: import ctypes ip=192.168.1.1 thisdll = ctypes.cdll['aDLL'] thisdll.functionThatExpectsAnIP(ip) how can I
Given the following code: var people = new List<person>(){ new person { Name =
Given the following code,the hover function works correctly, but when clicked, loses the clicked_no_event_box
Given the following code, is there a way I can call class A's version

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.