3

I want to merge the div with text called XXXXXxxxXXXXwith div which you can see above. I dont see there is colspan property as table has. Also i need to add overflow to that row.

Here is my Fiddle

Has someone idea how to fix this?

Expected output should be something like below . Also column with text "XXXX" should have overflow

enter image description here

James
  • 1,827
  • 5
  • 39
  • 69
  • Read this other thread: http://stackoverflow.com/questions/11190488/how-to-merge-two-divs . Maybe can help you – Charly66 Apr 23 '16 at 09:19
  • @Charly66 i need to merge column with text "XXXxxxxXXX" to 3 columns.. above row is 4 column – James Apr 23 '16 at 09:26
  • Possible duplicate of [HTML colspan in CSS](http://stackoverflow.com/questions/2403990/html-colspan-in-css) – Asons Apr 23 '16 at 09:36
  • 1
    What is the motivation behind trying to construct a table using divs, why not simply use a table? – enhzflep Apr 23 '16 at 09:39
  • As it all depends on how the rest of the table will look like, can you give a hint and I will suggest a proper solution. – Asons Apr 23 '16 at 09:45

3 Answers3

1

Something like this?

.dtable { 
    display:table;
    table-layout: fixed;
    width:529px;    
}

.drow { 
    display:table-row; 
    width:525px;    
}

.dcell {
    display:table-cell; 
    border:1px solid gray;
}


#D_Cell_1 {
    width:100px;
}

#Description {
    width:100px;
    height:58px;
}

#Des_Content{
    overflow-y: scroll;
    word-wrap: break-word;
    position: absolute;
    height:58px;
    width:425px;
}
<div id='main_wrapper' class='dtable'>
    <div id='control_panel_wrapper' class='drow'>
        <div id='D_Cell_1' class='dcell'>Title</div>
        <div id='D_Cell_2' class='dcell'>Manager marketing</div>
        <div id='D_Cell_3' class='dcell'>Application Deadline</div>
        <div id='D_Cell_4' class='dcell'>22.04.2012</div>
    </div>
</div>
<div class='dtable'>
    <div id='bottom_wrapper' class='drow'>
        <div id='Description' class='dcell'>Description</div>
        <div id='Des_Content' class='dcell'>LOREM IPSUM
dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,</div>
    </div>
</div>
Shady Alset
  • 5,548
  • 4
  • 21
  • 34
0

Add the next css

/*Row 1, Cell 2*/
.divTableRow:nth-child(1) .divTableCell:nth-child(2) {
  border-bottom-width : 0; /*Not border bottom*/
}

/*Row 2, Cell 2 */
.divTableRow:nth-child(2) .divTableCell:nth-child(2){
  border-top-width: 0; /*Not border top*/
}

https://jsfiddle.net/L9qh5o78/

Eduen Sarceño
  • 130
  • 1
  • 4
-1

Unfortunately, you can't use colspans and rowspans if you are creating tables using display:table.

Here is some more information

Alternatives -

1) Use HTML table instead(Recommended)

2) See how W3Schools have implemented it here

Rehban Khatri
  • 924
  • 1
  • 7
  • 19