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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:31:08+00:00 2026-05-12T23:31:08+00:00

I want to know the best way to mark up tabular data on a

  • 0

I want to know the best way to mark up tabular data on a web page when data rows contain complex data that can’t fit within a single table row.

Here’s a concrete example. The first line has a list of extra information attached to it about arms and legs.

Shadrach  M  Banana     12
  Arms  Blue    2
  Legs  Yellow  3
Meshgah   M  Apple      34
Abednego  M  Persimmon   0

Is there a good way to mark this up other than using a spanned cell containing a nested table like this?

+-------+--+--------+-----+
|       |  |        |     |
+-------+--+--------+-----+
| +-------+------+-+      |
| |       |      | |      |
| +-------+------+-+      |
| |       |      | |      |
| +-------+------+-+      |
+-------+--+--------+-----+
|       |  |        |     |
+-------+--+--------+-----+
|       |  |        |     |
+-------+--+--------+-----+

I’m not completely happy with this because the outer table has four columns, with specific headings and meanings; but the second row spans all four columns and contains something different. I really want this information to be part of the first line item (Shadrach), not part of the top-level table. But HTML doesn’t seem to allow me to do this.

Is there a better, more semantic way?

  • 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-12T23:31:08+00:00Added an answer on May 12, 2026 at 11:31 pm

    One thing you need to ask yourself when trying to make your markup more semantic is to what end you are doing it. Semantic markup has value because it’s easier to style, and apply different stylesheets to without having to customize them for the markup you are using. It has value because it aids accessibility, making it easier for screenreaders or alternative rendering engines to analyze it appropriately. And sometimes it has value because search engine or other automated tools can extract information from it.

    Sometimes, however, you come across a case that HTML just can’t handle. This seems to be one of them. HTML does not have any way of nesting hierarchical data in tables with columns that don’t match the other columns of the table. So, you need to do the best with what you’ve got. At this point, worrying about making it more semantic doesn’t buy you all that much; you’re doing something fairly special-case, that other stylesheets, screen readers, and tools probably won’t know what to do with, so pretty much any solution you come up with that isn’t completely contrary to the purpose of the elements in question is OK.

    I think the solution you mention is about the best you can do. Mark those rows containing nested tables with a class that indicates that they aren’t like the other rows, and call it good. If you wanted, you could group them together with the rows they are attached to using multiple <tbody> elements:

    <table>
    <tbody>
      <tr><td>Shadrach  <td>M  <td>Banana     <td>12
      <tr class=nested><td colspan=4>
        <table>...</table>
    <tbody>
      <tr><td>Meshgah   <td>M  <td>Apple      <td>34
    <tbody>
      <tr><td>Abednego  <td>M  <td>Persimmon   <td>0
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know the best way of testing data access functionality. I know
I want to know the best way of hosting a web application for different
I want to know the best way to do that: using (var backgroundWorker =
I want to know the best way how to obtain the basic info of
I want to know the best way to compare two objects and to find
i want to know the best way (faster and better) to structure the code
I want to know the best way of transferring a cryptographic initialization vector (IV)
I'm writing a web service for my application and want to know the best
I'm learning Scala and I want to know the best way of expressing this
I have a login in my application. I want to know the best way

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.