+ 1
to create table using css
creat a table
3 Respostas
+ 6
If you have to make a table object ( for present some table formatted data ) in your html page, use the <table><tr><td></td></tr></table> html element/structure, and style it with css ^^
If you have to make a table layout ( to organize/build your html page content ), use the most adapted html elements ( regarding their semantical meaning ) to your content, and change their default value of 'display' css property to one of 'table'-family, to recreate same kind of structure that's using for <table> html element/structure... using generic <div>s html elements:
<div class="myTable">
<div class="myRow">
<div class="myCell">
my first cell content
</div>
<div class="myCell">
my second cell content
</div>
<div class="myCell">
my third cell content
</div>
</div>
</div>
<style>
.myTable {
display:table;
table-layout:fixed; /* default: auto / use for change rule of size calculation ( content adapted or not ) */
border-collapse:separate; /* collapse or separate borders of cells */
border-spacing:5px 10px; /* space between separate borders of cells ( old and deprecated 'cellspacing' html attribute ) */
border:2px solid red; /* style of global 'table' box border -- not cells borders ^^ */
}
.myRow {
display:table-row;
/* almost styles applied to a 'table-row' ( including <tr> ) are not applied to it but to the 'table-cell' childs */
}
.myCell {
display:table-cell;
border:1px solid blue; /* style of cell borders */
padding:20px; /* equivalent to old deprecated 'cellpadding' html attribute '*/
}
</style>
+ 2
make a table with html and the use css for the style
+ 2
With Css you cannot make any tables. Use html