acoder
acoder

Reputation: 523

Table to DIV and CSS

Question: Can this be done using DIVs and CSS? (instead of a html table)


A table with 3 columns and 3 rows, horizontally aligned to center and vertically aligned to top.
When the content in the middle cell is bigger, then entire table is expanded to left, right and bottom.

Left and right columns width, top and bottom rows height shall not change.

enter image description here

The gray borders which can be seen in this picture are not important, they are invisible actually.

Upvotes: 0

Views: 123

Answers (1)

Sobin Augustine
Sobin Augustine

Reputation: 3765

CSS display Property values, use these

table Let the element behave like a <table> element   
table-caption Let the element behave like a <caption> element 
table-column-group    Let the element behave like a <colgroup> element    
table-header-group    Let the element behave like a <thead> element   
table-footer-group    Let the element behave like a <tfoot> element   
table-row-group   Let the element behave like a <tbody> element   
table-cell    Let the element behave like a <td> element  
table-column  Let the element behave like a <col> element 
table-row Let the element behave like a <tr> element

more reference: CSS display Property

So, documentation says, these values have only support with IE8 onwards, so you have to use the <table> element in IE7.

Upvotes: 1

Related Questions