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

Why are the boarders showing differently on a table?

Why are the boarders showing differently on a table?

Originally I had <div class="tr"> and things like that because the main body of my site is in flex inside @media screen. This specific portion of my site is on @media print

Here is my code for it:

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

HTML

<table>
    <tr>
        <th>Drug Names</th>
        <th>Prescriber</th>
        <th>Dose/Pill</th>
        <th>Frequency</th>
        <th>Rx Number</th>
        <th>Pharmacy</th>
        <th class="tinyBoxes">M</th>
        <th class="tinyBoxes">T</th>
        <th class="tinyBoxes">W</th>
        <th class="tinyBoxes">T</th>
        <th class="tinyBoxes">F</th>
        <th class="tinyBoxes">S</th>
        <th class="tinyBoxes">S</th>
        <th>Remaining
    </tr>
</table>

CSS

table {
    display: table;
    border: 1px solid black;
    border-collapse: collapse;
    width: 100%;
}

tr {
    display: table-row;
    border: 1px solid black;
    border: 1px solid black;
    border-collapse: collapse;
}

th {
    display: table-cell;
    font-weight: bold;
    border: 1px solid black;
    border-collapse: collapse;
    height: 50px;
    vertical-align: middle;
}

td {
    display: table-cell;
    border: 1px solid black;
    border-collapse: collapse;
    vertical-align: middle;
    text-align: center;
}

.tinyBoxes {
    width: 0.5cm;
    height: 0.5cm;
    display: table-cell;
    font-weight: bold;
    border: 1px solid black;
    border-collapse: collapse;
    vertical-align: middle;
}

An Image of what it’s displaying on Chrome (most current version): Image of table

Any ideas why the borders are being different?

ADDITIONAL INFO

I did a JSFiddle and it seems to work just fine on there. I guess it’s a browser thing…?

>Solution :

Remove

border: 1px solid black;

from ‘table’, ‘tr’ tags and ‘.tinyBoxes’ class in your CSS code, and just write it in the ‘th’ tag, then it’s OK.

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