Nicolas Frbezar Nicolas Frbezar - 6 months ago 7
HTML Question

CSS trouble to display a php generated HTML array

I have trouble with my CSS. I'm trying to correctly display this kind of array :

https://jsfiddle.net/ju8hmgp9/

I think the problem is maybe right there :

table {
display: table;
width:auto;
margin : auto;

border-spacing: 2px;
border-color: gray;
}

table td{
font-size: 8pt;

}
.empty{
background-color: #C7C7C7;
}

td, th {
display: table-cell;
vertical-align: inherit;
width: auto;
border: 1px solid gray;
border-collapse : collapse;
margin-left: 5px;
margin-right: 5px;
}


As i know, everything worked as well before, and i don"t know how to fix this. How can i fix my problem ?

Answer

In your JSFiddle you have applied display: block; to the td element. If you remove this then the table displays as it should.

https://jsfiddle.net/4bx4n8fk/1/

Comments