0

I have created a simple table with bottom row borders. In Firefox it works perfectly, and borders are being shown in the whole row, but in Chrome and IE 10 it shows only on part of the row :

<div style="display:table; border-collapse: collapse; width: 100%"> <div style="display:table-row; border-bottom: 1px solid black;"> <div style="display:table-cell;">a </div> <div style="display:table-cell; width: 15%;">b </div> </div> <div style="display:table-row; border-bottom: 1px solid black;"> <div style="display:table-cell; width: 15%;">a </div> <div style="display:table-cell; width: 15%;">c </div> </div> <div style="display:table-row; border-bottom: 1px solid black;"> <div style="display:table-cell;">a </div> <div style="display:table-cell; width: 15%;">b </div> <div style="display:table-cell; width: 15%;">c </div> </div> </div> 

fiddle link

Maybe someone know how to fix this problem?

4
  • (A) in-line styling is horrible (B) You haven't actually said whats wrong/desired clearly and (C) I believe it to be working exactly as it should be? Commented Dec 17, 2014 at 13:27
  • I have said that borders are not showed to whole row, it is being showed only to part of the row. Commented Dec 17, 2014 at 13:30
  • I don't see a table at all! I see a div doing exactly as it should be, given the properties you have given it. If you want a 'bottom border', why don't you just add a hr tag? Commented Dec 17, 2014 at 13:31
  • What you are trying to do is to emulate table cell collspan. Unlikely you will succeed, though. It's much simpler to use normal table. Commented Dec 17, 2014 at 13:34

1 Answer 1

2

Add empty divs.

<div style="display:table; border-collapse: collapse; width: 100%"> <div style="display:table-row; border-bottom: 1px solid black;"> <div style="display:table-cell;">a</div> <div style="display:table-cell; width: 15%;">b</div> <div style="display:table-cell; width: 15%;"></div> </div> <div style="display:table-row; border-bottom: 1px solid black;"> <div style="display:table-cell; width: 15%;">a</div> <div style="display:table-cell; width: 15%;">c</div> <div style="display:table-cell; width: 15%;"></div> </div> <div style="display:table-row; border-bottom: 1px solid black;"> <div style="display:table-cell;">a</div> <div style="display:table-cell; width: 15%;">b</div> <div style="display:table-cell; width: 15%;">c</div> </div> </div>

Note: Haven't tested on IE.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.