Creating table using Div in HTML

Sheonarayan
Posted by Sheonarayan under HTML 5 category on | Points: 40 | Views : 1009
Use below code snippet.

   <div style="display:table">
<div style="display:table-row">
<div style="display:table-cell;border:1px solid #c0c0c0;padding:5px;">cell 1</div>
<div style="display:table-cell;border:1px solid #c0c0c0;padding:5px;">cell 2</div>
<div style="display:table-cell;border:1px solid #c0c0c0;padding:5px;">cell 3</div>
</div>
<div style="display:table-row">
<div style="display:table-cell;border:1px solid #c0c0c0;padding:5px;">cell 1</div>
<div style="display:table-cell;border:1px solid #c0c0c0;padding:5px;">cell 2</div>
<div style="display:table-cell;border:1px solid #c0c0c0;padding:5px;">cell 3</div>
</div>
</div>


This will create two rows and three columns in each rows.

Thanks

Comments or Responses

Login to post response