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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:25:07+00:00 2026-06-06T17:25:07+00:00

I have a simple html table element. <table border=2 cellpadding=5 cellspacing=0 width=40%> <tr><td> aaa

  • 0

I have a simple html table element.

<table border="2" cellpadding="5" cellspacing="0" width="40%">
    <tr><td> aaa </td><td> bbb </td></tr>
    <tr><td> ccc </td><td> ddd </td></tr>
</table>

Now doing my first steps in CSS, I’m try trying to define the latter table style as CSS .

I cannot achieve it – the border looks different whatever I do.
Please help.

My HTML with CSS style :

<style type="text/css">
table.my_class
{
    width:40%;
}
table.my_class,table.my_class tr, table.my_class td
{
    border-color: black;
    border-width: 2px;
    border-style:groove;
    padding:15px;
    border-collapse:collapse;
}
</style>

<table class="my_class">
    <tr><td> aaa </td><td> bbb </td></tr>
    <tr><td> ccc </td><td> ddd </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-06T17:25:09+00:00Added an answer on June 6, 2026 at 5:25 pm

    HTML

    <table border="2" cellpadding="5" cellspacing="0" width="40%">
        <tr><td> aaa </td><td> bbb </td></tr>
        <tr><td> ccc </td><td> ddd </td></tr>
    </table>
    <br/>
    <table class="mytable">
        <tr><td> aaa </td><td> bbb </td></tr>
        <tr><td> ccc </td><td> ddd </td></tr>
    </table>​
    

    Here is the solution without reset.css
    CSS

    table.mytable {
     width: 40%;
     border: 2px solid #444;  
     border-spacing: 0;    
    }
    
    table.mytable tr {border-bottom: 1px solid #444}
    
    table.mytable td{
      border-right: 1px solid #444;
      border-bottom: 1px solid #444;
      padding: 5px;
    }
    
    table.mytable tr td:last-child{ border-right: 0 }
    table.mytable tr:last-child td{ border-bottom: 0 }
    

    Here is the solution with reset.css
    CSS

    table.mytable {
     width: 40%;
     border: 2px solid #000;    
    }
    
    table.mytable td{
      border: 1px solid #000;
    }
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following: <ul style=width: 300px; list-style-type:none> <li> <table style=width:100% border=0 cellpadding=0 cellspacing=0
I have a very simple html page with a table element. The document is
I have a simple HTML Table (10 columns x 500 rows). When the page
I have a simple HTML table which is bound using knockoutJS. However, I've added
I'm trying to have a simple html table, that highlights a row as a
I have a simple table like this <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
I have the following task: there are a simple table from mysql database: <html>
I have a simple html form. This form has a specific width and margin
I have a simple fixed width table. The first column has a fluid width
I am populating an element with some html: table, checkboxes. I have an onclick

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.