0
I am mounting a table in div and css, the problem is that I need the div div-table-Row to have the size the other Divs. but she keeps breaking lines. How do I fix this?
Follows my code:
.div-table{
display:table;
width: 502px;
}
.div-table-row{
display:table-row;
width: 50%;
}
.div-table-col{border: 1px solid #484848;
display:table-cell;
padding: 5px;
width: 50%;
}
<div class='div-table'>
<div class='div-table-row'>
<div class='linha font-2'>nosdaasdme nodasdasdme nosdasdasdsdme</div>
</div>
<div class='div-table-row'>
<div class='div-table-col font-1'>(ID: ) - QTD:</div>
<div class='div-table-col font-1'>R$</div>
<div class='div-table-col font-1'>MOUSE</div>
</div>
</div>
Why create a table with Divs? Since there is already a table and ,tr, th and td for this? Follow this basic rule, tables are for tabular data and Divs for dividing and organizing the layout. It seems to me you want to put together a list of tabular data then
<table>
will be right with you. This story that using table is wrong was poorly explained, in fact it is wrong to use for page layouts, but to show tabular data similar to Excel is perfectly acceptable.– Guilherme Nascimento
I’m actually putting together a layout, and I used it as an example.
– Hugo Borges
The visual structure seems to me of tabular data, I think that maybe you have not understood this. Tabular data is the schema that all columns and rows follow the same size proportional to each other. From a query in the term.
– Guilherme Nascimento