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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:02:00+00:00 2026-05-31T01:02:00+00:00

This is my table: <table width=100%> <tr ><td width=35% height=30 class=left-info >Criminal Id :</td>

  • 0

This is my table:

<table width="100%">
<tr ><td width="35%" height="30" class="left-info" >Criminal Id :</td>
<td width="65%"  class="right-info" >CR7887898652</td></tr>
<tr><td height="30"  class="right-info" >Full Name :</td><td  class="left-info" ></td></tr>
<tr><td height="30"  class="right-info" >Date of Birth :</td><td  class="left-info" ></td></tr>
</table>

How can I remove these repeating use of class for each table data. As, I’ve used class="left-info" for left side table data and class="right-info" for right side table data. But, this make the mesh of coding, can anyone suggest me how can I do the same style with minimal code?

  • 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-31T01:02:01+00:00Added an answer on May 31, 2026 at 1:02 am

    You can either switch to a non-table layout (perhaps a DL may suit your needs better), or if you must use a table, consider using the col element, which you can apply a class attribute to.

    Example

    Using your example above, this is how I would suggest using the col element.

    <table id="example">
        <col class="label" />
        <col class="value" />
    
        <tr>
            <td>Criminal Id :</td>
            <td>CR7887898652</td>
        </tr>
        <tr>
            <td>Full Name:</td>
            <td>Foo Bar</td>
        </tr>
        <tr>
            <td>Date of Birth:</td>
            <td>01/14/1983</td>
        </tr>
    </table>
    

    But, taking into account your example, I think you could accomplish your goal with better semantics and less code if you make use of TH elements and pure CSS:

    #example th {
        text-align: right;
        font-weight: normal;
    }
    
    #example td {
        text-align: left;
    }
    

    …

    <table id="example">
        <tr>
            <th>Criminal Id :</th>
            <td>CR7887898652</td>
        </tr>
        <tr>
            <th>Full Name:</th>
            <td>Foo Bar</td>
        </tr>
        <tr>
            <th>Date of Birth:</th>
            <td>01/14/1983</td>
        </tr>
    </table>
    

    At this level, it shouldn’t really matter if you use a DL or a TABLE as they both are semantically rich elements when used like this. IMHO, I still prefer a DL, but truthfully they can be more difficult to style.

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

Sidebar

Related Questions

I have the following html page: <body> <div class=hide1 style=width:1000px; height:1000px;> <table width=100% border=0
I have this in HTML: <div class=dataBurst title=What is the Matrix?> <table align=center height=100%>
I've got a table arranged like this: <table style=width:100% class=ui-widget-content> <tr> <td rowspan=2 style=width:100px;padding:10px>
So far, I'm doing this programmatically using VB.net/ASP.net: <table cellspacing=0 cellpadding=4 border=0 style=border- width:0px;width:100%;border-collapse:collapse;font-size:12px;>
I want to create a squared table 9x9, width and height should be 100%,
This is more like a question of principle. I made a table with 100%
The error label displays till the width of the table. As this: alt text
<div class=sectiuni_home_box style=width: 626px; padding-left: 0px;> <div class=sectiuni_home_box_t style=border-left: 0; width: 618px;> <div class=sectiuni_home_box_v
Here's a basic illustration of the problem: <html><head><style type=text/css> html {width: 100%; height: 100%;
<form action= method=post id=SaveIndicationsExportForm> <table cellspacing=0 cellpadding=0 id=hover style=float: left;> <tbody> <tr> <td class=hoverButtonLeft

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.