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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:53:09+00:00 2026-06-06T13:53:09+00:00

The first row in my table has three cells. I’m trying to set up

  • 0

The first row in my table has three cells. I’m trying to set up a second row with four cells. I would like the borders to all be the same. I cannot, however, achieve that so far as the cells on the bottom row (the row with four cells) either has a double border, or no border. I’ve tired border-collapse and border-style-right, with no luck. How can I have the bottom row look just like the top row – with a single 1px border – except 4 cells in stead of three cells? Here’s my code:

<style type="text/css"> 
table
{
    border-collapse:collapse;
}
table.outer
{
    border: 1px black solid;
    border-collapse: collapse;
    width:750px;
}
table.outer td
{
    border: 1px black solid;
    border-collapse: collapse;
}
table.nested
{
    width: 750px;
}
table.nested td
{
    border:0px black solid;
    border-collapse:collapse;
}   
</style>    
</head>
<body>

<table class="outer">
  <tr>
    <td>foo 1</td>
    <td>foo 2</td>
    <td>foo 3</td>
  </tr>
        <td colspan="3">
            <table class="nested">
              <tr>
                <td>bar 1</td>
                <td>bar 2</td>
                <td>bar 3</td>
                <td>bar 4</td>
              </tr> 
            </table>
        </td>   
</table>

  • 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-06T13:53:12+00:00Added an answer on June 6, 2026 at 1:53 pm

    Is there any reason why you must have a nested table? If you want the two rows to look identical, try adding more rows and adjusting the colspan of each cell. If you find the least common multiple of both three and four, you can make a table that has twelve columns and set the colspan of a row with three columns to four and the colspan of a row with four columns to three.

    Nesting tables within tables can be problematic with CSS and it is also heavier for the page.

    <table class="outer">
      <tr>
        <td colspan="4">foo 1</td>
        <td colspan="4">foo 2</td>
        <td colspan="4">foo 3</td>
      </tr>
      <tr>
        <td colspan="3">bar 1</td> 
        <td colspan="3">bar 2</td>
        <td colspan="3">bar 3</td>
        <td colspan="3">bar 4</td>
      </tr>
    </table>
    

    This way, you can also style all of the cells with just one CSS td selector, if you wanted to share a common style between the two rows.

    Extra explanation of answer:
    (Using the LCM as the total number of columns for the table ensures that each cell can be the same size as the other cells in its row, without affecting the size of cells in other rows. You can make a row with n cells as long as the total number of columns in the table is divisible by n. Thus, with this twelve column wide table, you can have rows with 1, 2, 3, 4, 6, or 12 columns, and all cells can be centered about the middle of the table. Also, if you want to dynamically generate a table, it wouldn’t be too hard to write a function to create however many cells you need in each row with this method.)

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

Sidebar

Related Questions

I have a table with 3 rows. Each row has 3 td. The first
Is it possible to display all but first row from a table in sql
First i gave all values of row in JTAble. While inserting table values into
I want to delete some data displayed in a HTML table row (first on
say I want to make the first row of the excel ss something like
I have a table with multiple tbody's, each of which has a classed row,
I am trying to create a JTable that has a row header that looks
I am trying to get the cells from 1st column in a table. Getting
What I'm trying to achieve is three divs in a row with different, specific
The first row is the container for search results to be displayed after user

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.