html - Redesign grid-layout without table-tags -
i'm reworking existing module make more adaptive. below general mock-up of current design. design used multiple things, , goal adding or removing modules should easy.
right now, we're using html <table>
achieve lay-out, using col-span
, row-span
everywhere, becomes messy, fast (especially if want remove module, or add module of different size).
what proper way work around this, be? i'm not looking after full solution, i'd rather have small example can extend on.
i tried bootstrap, of modules have fixed sizes, messes grid-design of bootstrap. float has issues vertical stacking, ...
code snippet of how it's created right now:
<table> <tbody> <tr> <td colspan="4" rowspan="2">module</td> <td>module</td> <td colspan="3" rowspan="2">module</td> </tr> <tr><td>module</td></tr> </tbody> </table>
customize grid according needs
<!doctype html> <html lang="en"> <head> <title>bootstrap example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container-fluid"> <h1>hello world!</h1> <p>resize browser window see effect.</p> <div class="row"> <div class="col-sm-3" style="background-color:lavender;">.col-sm-3</div> <div class="col-sm-6" style="background-color:lavenderblush;">.col-sm-6</div> <div class="col-sm-3" style="background-color:lavender;">.col-sm-3</div> </div> <div class="row"> <div class="col-sm-6" style="background-color:black;">.col-sm-6</div> <div class="col-sm-3" style="background-color:green;">.col-sm-3</div> <div class="col-sm-3" style="background-color:blue;">.col-sm-3</div> </div> </div> <div class="row"> <div class="col-sm-6" style="background-color:red;">.col-sm-6</div> <div class="col-sm-3" style="background-color:pink;">.col-sm-3</div> <div class="col-sm-3" style="background-color:yellow;">.col-sm-3</div> </div> </div> </body> </html>
Comments
Post a Comment