Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

HTML table borders not showing

I want to include HTML table on my project. The problem is that I created a table and it seems to have very little styling, including no borders at all. I commented out my CSS code, JS code and most parts of HTML code and tried it out in multiple situations but still nothing. I also tried it in 3 different browsers (Brave, Chrome, Edge). What am I missing? I don’t use Bootstrap or whatever so styling is not compromised by 3rd party library.

<div class="wrapper">
  <div class="input-container" id="income-input-container">
    <h4>Add income</h4>
    <input type="text" placeholder="Name" id="income-name">
    <input type="text" placeholder="Amount" id="income-amount">
    <input type="date" value="2022-03-15" min="2010-01-01" max="2022-03-15" id="income-date">
    <select id="income-category">
      <option value="Not categorized">Not categorized</option>
      <option value="Job">Job</option>
      <option value="Business">Business</option>
      <option value="Investments">Investments</option>
    </select>
    <button class="submit-button">Submit</button>
  </div>
  <div class="input-container" id="expense-input-container">
    <h4>Add expense</h4>
    <input type="text" placeholder="Name" id="expense-name">
    <input type="text" placeholder="Amount" id="expense-amount">
    <input type="date" value="2022-03-15" min="2010-01-01" max="2022-03-15" id="expense-date">
    <select id="expense-category">
      <option value="Not categorized">Not categorized</option>
      <option value="Clothing">Clothing</option>
      <option value="Medical">Medical</option>
      <option value="Hobbies">Hobbies</option>
      <option value="Travel">Travel</option>
      <option value="Bills">Bills</option>
    </select>
    <button class="submit-button">Submit</button>
  </div>
  <table>
    <thead>
      <tr>
        <th>Name</th>
        <th>Type</th>
        <th>Amount</th>
        <th>Date</th>
        <th>Category</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>This name</td>
        <td>This type</td>
        <td>200$</td>
        <td>2021-03-04</td>
        <td>Travel</td>
      </tr>
    </tbody>
  </table>
</div>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Initial a table has no styles. You have to style it on your own.

Here is minimalistic working example:

table {
  border-collapse: collapse;
}

td,
th {
  border: 1px solid black;
}
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Amount</th>
      <th>Date</th>
      <th>Category</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>This name</td>
      <td>This type</td>
      <td>200$</td>
      <td>2021-03-04</td>
      <td>Travel</td>
    </tr>
  </tbody>
</table>

And here are some informations about styling a table

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading