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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:24:48+00:00 2026-06-10T08:24:48+00:00

I have a HTML table, where cell #3 and cell #4 have inner tables.

  • 0

I have a HTML table, where cell #3 and cell #4 have inner tables.

I need the rows in each table in cell #3 and cell#4 to line up correctly.

The problem is sometimes the length of text line a row may go beyond a single line, and the other table doesn’t have this so the lines don’t match up.

How can I correct this seeing as the data is coming from the database which I don’t have control of?

I have created a jsfiddle: http://jsfiddle.net/HPkvV/

<style>
.main
{
 border: 1px solid #000000;
}
.main td
{
 border: 1px solid #000000;
}
.grid
{
    border-left: none !important;
    border-right: none !important;
    border-top:1px solid #dddddd;
    border-bottom:1px solid #dddddd;
}
.grid td
{
    border-left: none !important;
    border-right: none !important;
    border-top:1px solid #dddddd;
    border-bottom:1px solid #dddddd;
}
</style>



<table width="400">
<tr>
    <td>
        <table width="100%" class="main">
            <td valign=top>column 1</td>
            <td valign=top>column 2</td>
            <td valign=top>column 3
                <table id="names" class="grid">
                    <tr>
                        <td>line 1</td>
                    </tr>
                    <tr>
                        <td>line 2</td>
                    </tr>
                    <tr>
                        <td>line 3</td>
                    </tr>
                </table>
            </td>
            <td valign=top>column 4
                <table id="desc" class="grid">
                    <tr>
                        <td>line 1 description is a little too long so it wraps line 1 description is a little too long so it wraps</td>
                    </tr>
                    <tr>
                        <td>line 2 description</td>
                    </tr>
                    <tr>
                        <td>line 3 description</td>
                    </tr>
                </table>
            </td>

        </table>
    </td>
</tr>
</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-10T08:24:49+00:00Added an answer on June 10, 2026 at 8:24 am

    is there a reason that you are using nested tables? The second set of information looks like maybe it could be contained by a list. If that was the case it would be a lot easier to make everything play nice.

    Styles

    .main
    {
     border: 1px solid #000000;
    }
    .main td, .main th
    {
     border: 1px solid #000000;
        vertical-align: top;
    }
    .grid li
    {
        height: 4em; /*  this is the value that will help you get them even.  Though you will be guessing, hoping that no content runs too long.*/
        border-bottom:1px solid #dddddd;
    }
    

    HTML

    <table class="main">
        <thead>
            <tr><th>Column 12</th>
            <th>Column 2</th><th>Column 3</th><th>Column 4</th></tr>
        </thead>
        <tbody>                    
            <tr>
                <td>foo</td>
                <td> bar</td>
                <td>
                    <ul class="grid">
                        <li>
                            line 1
                        </li>
                        <li>
                            line 2
                        </li>
                        <li>
                            line 3
                        </li>
                    </ul>
                </td>
                <td>
                    <ul class="grid">
                        <li>
                            line 1 description is a little too long so it wraps line 1 description is a little too long so it wraps
                        </li>
                        <li>
                            line 2 description
                        </li>
                        <li>
                            line 3 description
                        </li>
                    </ul>                
                </td>
            </tr>
        </tbody>
    </table>​
    

    It’s not a complete solution without a bit of knowledge about the data.
    I updated your fiddle with this solution as well.

    Whoops new Fiddle http://jsfiddle.net/HPkvV/2/

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

Sidebar

Related Questions

I have a HTML table. Each cell has content of different length. For this
I have an HTML table where the first cell of each row contains text
I have a html table with ~500cells. Each cell has a input text. I
I have set up a basic html table with a reader in each cell
I have some text inside a html table cell. The text is centered. <td
I have an HTML table of data where each cell can have multiple lines
I have an HTML table, where each cell contains a large amount of data.
see fiddle i have html table and one textbox and one button.make cell selection
I have HTML table. I'm looping through table and iterate over each row whose
I have an HTML table in my jsp page. This conains text fields and

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.