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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:59:20+00:00 2026-06-10T07:59:20+00:00

I’m trying to be a good developer and not use tables, but I’ve been

  • 0

I’m trying to be a good developer and not use tables, but I’ve been unsuccessful. Here’s my attempt…

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Because some people complain if I don't specify all the obvious tags</title>
</head>
<body>
    <div style="width:100%">
        <div style="background-color:Purple;width:25px;float:right"><input type="button" style="width:15px" /></div>
        <div style="background-color:Aqua"><input style="width:100%" /></div>
    </div>
</body>
</html>

This is the output that I get. I was hoping the input box would be on the left side of the button, but unfortunately it’s underneath.

Output

To demonstrate what I want, this is how I would do it if I were to use a table:

<table style="width:100%">
    <tr>
        <td style="background-color:Aqua"><input style="width:100%;box-sizing: border-box" /></td>
        <td style="background-color:Purple;width:25px"><input type="button" style="width:15px" /></td>
    </tr>
</table>

Expected output

Please note:

  • I can’t change the doctype tag
  • The solution must not use tables
  • This should work regardless of the size specified in the containing div, which is currently set to 100%.

Thank you 🙂

  • 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-06-10T07:59:22+00:00Added an answer on June 10, 2026 at 7:59 am

    If I had a working table layout as you do, I’d do something like this:

    .layout-table
    {
        display: table;
    }
    .layout-table > div
    {
        display: table-row;
    }
    .layout-table > div > div
    {
        display: table-cell;
    }
    

    And then:

    <div class="layout-table" style="width:100%">
        <div>
            <div style="background-color:Aqua">
                <input style="width:100%;box-sizing: border-box">
            </div>
            <div style="background-color:Purple;width:25px">
                <input type="button" style="width:15px">
            </div>
        </div>
    </div>
    

    Fiddle

    Of course, all that styling would be done externally too, but you get the point. This is identical to your table layout, but it’s done with divs styled to act like tables, separating layout from content.

    Actually, I would probably be lazy and just use <table role="presentation"> but that’s bad (not to mention invalid with your obsolete doctype).

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.