How to make borders collapse on a div

0 votes

This is my code:

<div class="container">
    <div class="column">
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
    </div>
    <div class="column">
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
    </div>
    <div class="column">
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
    </div>
    ...
</div>

Then CSS

.container {
    display: table;
    border-collapse: collapse;
}
.column {
    float: left;
    overflow: hidden;
    width: 120px;
}
.cell {
    display: table-cell;
    border: 1px solid red;
    width: 120px;
    height: 20px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

Why do the cells that have displayed: table-cell and border-collapse: collapse in the outer div still not collapse? What do I not see here?

By the way, a column may contain a variable amount of cells, therefore I can't have borders on only one side.

Jul 25, 2022 in CSS by Edureka
• 13,620 points
1,660 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In CSS

0 votes
1 answer

How can I make a div stick to the top of the screen once it's been scrolled to?

To make an element sticky, use the ...READ MORE

answered Aug 5, 2022 in CSS by Tanishqa
• 1,170 points
4,193 views
0 votes
1 answer

Best way to center a <div> on a page vertically and horizontally?

The legitimate way to do that irrespective ...READ MORE

answered Jun 28, 2022 in CSS by Edureka
• 12,690 points
362 views
0 votes
1 answer

How to make div background color transparent in CSS

To begin, we will build a div> ...READ MORE

answered Jun 28, 2022 in CSS by Edureka
• 12,690 points
1,754 views
0 votes
0 answers

How to make a back-to-top button using CSS and HTML only?

I want to scroll down and up ...READ MORE

Jun 30, 2022 in CSS by Edureka
• 13,620 points
320 views
0 votes
0 answers

How to make a transparent border using CSS?

Ideally, the border should be translucent. That ...READ MORE

Jul 4, 2022 in CSS by Edureka
• 13,620 points
409 views
0 votes
0 answers

How to make a vertical line in HTML

How do you make a vertical line ...READ MORE

Jul 29, 2022 in CSS by Edureka
• 13,620 points
218 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
9,626 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
2,550 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,360 points
686 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP