html - Getting table structure with div with grouped divs -


i want tabular data in groups. wanted cells of equal width. please refer code below.

  .details {        display: table;        width: 100%;    }    .row {        display: table-row;    }    .cell1, .cell2, .cell3 {         width: 100%;         display: table-cell;         border: 1px solid gray;      }    .groups {         border: 1px solid red;    }      .group-name {         font-weight: bold;    }             
    <div class="details">           <div class="groups">                <div class="group-name">                           1                </div>                <div class="list">                   <div class="row">                         <div class="cell1">                              cell1                         </div>                         <div class="cell2">                              cell2                         </div>                         <div class="cell3">                              cell3                         </div>                    </div>                    <div class="row">                         <div class="cell1">                              cell1                         </div>                         <div class="cell2">                              cell2                         </div>                         <div class="cell3">                              cell3                         </div>                    </div>                </div>           </div>           <div class="groups">                <div class="group-name">                           2                </div>                <div class="list">                   <div class="row">                         <div class="cell1">                              cell1                         </div>                         <div class="cell2">                              cell2 lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.                         </div>                         <div class="cell3">                              cell3                         </div>                    </div>                    <div class="row">                         <div class="cell1">                              cell1                          </div>                         <div class="cell2">                              cell2 lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.                         </div>                         <div class="cell3">                              cell3 big lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.                         </div>                    </div>                </div>           </div>      </div>

add flex equal size.

 .details {        display: table;        width: 100%;    }    .row {        display: table-row;        display:flex;    }    .cell1{         width: 30%;         display: table-cell;         border: 1px solid gray;        flex: 1;        padding: 1em;        }   .cell2 {         width: 30%;         display: table-cell;         border: 1px solid gray;          flex: 1;         padding: 1em;         }   .cell3 {         width: 30%;         display: table-cell;         border: 1px solid gray;         flex: 1;           padding: 1em;        }    .groups {         border: 1px solid red;    }      .group-name {         font-weight: bold;    }
<div class="details">           <div class="groups">                <div class="group-name">                           1                </div>                <div class="list">                   <div class="row">                         <div class="cell1">                              cell1                         </div>                         <div class="cell2">                              cell2                         </div>                         <div class="cell3">                              cell3                         </div>                    </div>                    <div class="row">                         <div class="cell1">                              cell1                         </div>                         <div class="cell2">                              cell2                         </div>                         <div class="cell3">                              cell3                         </div>                    </div>                </div>           </div>           <div class="groups">                <div class="group-name">                           2                </div>                <div class="list">                   <div class="row">                         <div class="cell1">                              cell1                         </div>                         <div class="cell2">                              cell2 lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.                         </div>                         <div class="cell3">                              cell3                         </div>                    </div>                    <div class="row">                         <div class="cell1">                              cell1                          </div>                         <div class="cell2">                              cell2 lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.                         </div>                         <div class="cell3">                              cell3 big lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.                         </div>                    </div>                </div>           </div>      </div>


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -