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 6952757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:23:24+00:00 2026-05-27T14:23:24+00:00

I am trying to build a data grid for an Aircraft resource. The page

  • 0

I am trying to build a data grid for an Aircraft resource. The page has a header, a link for creating a new record, and the table. I have the following HTML:

<div id=body>
    <h2 class="left">Aircraft</h2>
    <%= link_to 'New...', new_aircraft_path, :class => 'button right' %>
    <div style="clear: both;"></div>
    <table>
        (omitted for brevity)
    </table>
</div>

and the following CSS:

.left {
  float: left;
}

.right {
  float: right;
}

.button {
  (omitted for brevity)
}

The table approximately extends to use about 25% on my screen. The New... button however, which is floating right, extends to far right side of the screen (100%). I need to extend only as far as the table, which is about 25%. How can I constraint the width of the div to only extend as far as the table?

This picture illustrates the problem

  • 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-27T14:23:25+00:00Added an answer on May 27, 2026 at 2:23 pm

    You can define the width of the table to a set number, and then wrap the button in a div with the same width. http://jsfiddle.net/j5GRH/

    If the width of the table is flexible, you can add the button inside the table: http://jsfiddle.net/j5GRH/3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a data mart. I have lot of dimensions, and
I have a grid of products, and I'm trying to build a dynamic filtering
I am new to Django and I am trying to build a data hierarchy
I am trying to build a data table structure that will best support the
I am trying to build a Quadtree data structure(or let's just say a tree)
I am trying to build a BehaviourTree data structure. The main class is BTNode,
I'm trying to build render the raw data from a Quake 3 .map file
I am trying to build a website where I can read the data from
I'm having this problem. I'm trying to build an UITableView with data from a
I am trying to build a table with large dataset and would like to

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.