The following is the output of the react code:
.borderCell {
border: 1px solid #e0e0e0;
}
.shiftCell{
background-color:#ff99cc;
min-width:27px;
text-align: center;
}
.shiftContent:focus{
outline: none
}
.shiftContent{
padding: 0px;
margin: 0px;
}
.shiftContent::-moz-selection{
background: none;
}
.shiftContent::selection{
background: none;
}
.littleSquareDiv {
background-color: rgb(0, 140, 255);
top: calc(100% - 3px);
left: calc(100% - 3px);
height: 6px;
position: absolute;
width: 6px;
z-index: 10;
}
.littleSquareDiv:hover {
cursor: crosshair;
}
.selectCellBorderBottom{
border-bottom: 1px solid rgb(0, 140, 255);
}
.selectCellBorderLeft{
border-left: 1px solid rgb(0, 140, 255);
}
.selectCellBorderRight{
border-right: 1px solid rgb(0, 140, 255);
}
.selectCellBorderTop{
border-top: 1px solid rgb(0, 140, 255);
}
<table class="m-3">
<tbody>
<tr>
<td class="borderCell shiftContent " contenteditable="true">0,0</td>
<td class="borderCell shiftContent " contenteditable="true">1,0</td>
<td class="borderCell shiftContent " contenteditable="true">2,0</td>
</tr>
<tr>
<td class="borderCell shiftContent " contenteditable="true">0,1</td>
<td class="borderCell shiftContent selectCellBorderTop selectCellBorderBottom selectCellBorderRight selectCellBorderLeft" contenteditable="true">1,1</td>
<td class="borderCell shiftContent " contenteditable="true">2,1</td>
</tr>
<tr>
<td class="borderCell shiftContent " contenteditable="true">0,2</td>
<td class="borderCell shiftContent " contenteditable="true">1,2</td>
<td class="borderCell shiftContent " contenteditable="true">2,2</td>
</tr>
</tbody>
</table>
When I place the code to jsfiddle, the central cell 4 border can be shown successfully.
Unfortunately, when the above code is outputted by react(please click the central cell) only the right, the bottom border of the central cell can be shown successfully.
Would you tell me why?
The expected result as below:
4
Answers
Finally, I changed the CSS as below:
It works fine.
Are you like the see the table like this?
I noticed the following CSS code (maybe added by bootstrap):
Try adding the following to your code:
Are you like the see the table like this?