{"id":34604,"date":"2017-12-03T03:02:48","date_gmt":"2017-12-02T17:02:48","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=34604"},"modified":"2019-08-11T15:58:22","modified_gmt":"2019-08-11T05:58:22","slug":"css3-flexbox-table-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/css3-flexbox-table-tutorial\/","title":{"rendered":"CSS3 Flexbox Table Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dropcomparisonpunt.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"CSS3 Flexbox Table Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/\/HTMLCSS\/flexmore.jpg\" title=\"CSS3 Flexbox Table Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">CSS3 Flexbox Table Tutorial<\/p><\/div>\n<p>If you were around for the recent <a title='CSS3 Flexbox Primer Tutorial' href='#css3fpt'>CSS3 Flexbox Primer Tutorial<\/a> and the concept of CSS3&#8217;s &#8230;<\/p>\n<p><code><br \/>\ndisplay: <a target=_blank title='CSS3 Flexbox information from w3schools' href='https:\/\/www.w3schools.com\/css\/css3_flexbox.asp'>flex<\/a>;<br \/>\nflex-direction: row; \/\/ default, or row-reverse or column or column-reverse<br \/>\n<\/code><\/p>\n<p> &#8230; and this was new to you regarding styling that can apply to a &#8220;parent&#8221; element of &#8220;children&#8221;, did you wonder as an almost immediate thought, as I had &#8230;<\/p>\n<blockquote><p>\nWhat happens with this CSS3 flexbox styling within an HTML table, specifically if you try it on a table&#8217;s <i>tr<\/i> (row) element?\n<\/p><\/blockquote>\n<p>Well, the answer is, you can &#8220;warp&#8221; a table, just for one or a few rows if you like, using this CSS3 flexbox styling.  We found out by incorporating dynamic CSS3 flexbox styling possibilities into a web application (about the trajectory of drop punt in Australian Rules football) of the past that had a set number of table rows (with ID defined) in HTML and CSS and Javascript code you could try yourself at this <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dropcomparisonpunt.htm\" title=\"Click picture\">live run<\/a> link (with its underlying <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dropcomparisonpunt.html---GETME\">dropcomparisonpunt.htm<\/a> changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dropcomparisonpunt.html---GETME\">this way<\/a>).  We did this via an added HTML select &#8220;dropdown&#8221; element as per &#8230;<\/p>\n<p><code><br \/>\n&lt;select onchange=\" var trs, jtrs, itrs, its=['tr','h1'], wis=window.getComputedStyle(document.getElementsByTagName('table')[1], null).getPropertyValue('width'); if (wis.indexOf('px') == -1 || 1 == 1) { wis='100%'; } for (jtrs=0; jtrs&lt;its.length; jtrs++) {  trs=document.getElementsByTagName(its[jtrs]); for (itrs=0; itrs&lt;trs.length; itrs++) { trs[itrs].style.width=wis; trs[itrs].style.display='flex'; trs[itrs].style.flexDirection=this.value; } wis='100%'; document.getElementById('oflex' + jtrs).innerHTML=document.getElementById('oflex' + jtrs).innerHTML.replace('t view','t flex view'); }  \" id='sflex'&gt;&lt;option value='row' id='oflex0'&gt;Left to Right view&lt;\/option&gt;&lt;option value='row-reverse' id='oflex1'&gt;Right to Left flex view&lt;\/option&gt;&lt;\/select&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; which as you may have surmised applies, optionally, and in a user controlled way, CSS3 flexbox styling (only the row* options, though) to both &#8230;<\/p>\n<ol>\n<li><i>tr<\/i> table row elements &#8230; and &#8230;<\/li>\n<li><i>h1<\/i> header element<\/li>\n<\/ol>\n<p> &#8230; with interesting visual effects &#8230; we think?!  Perhaps &#8220;you think&#8221; too?!<\/p>\n<hr>\n<p id='css3fpt'>Previous relevant <a target=_blank title='CSS3 Flexbox Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/css3-flexbox-primer-tutorial\/'>CSS3 Flexbox Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flextest.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"CSS3 Flexbox Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/\/HTMLCSS\/flextest.jpg\" title=\"CSS3 Flexbox Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">CSS3 Flexbox Primer Tutorial<\/p><\/div>\n<p>Responsive design is an important aspect to modern web design, because of the realities of the online world&#8217;s push to mobile devices, with their smaller device widths.  As the <a target=_blank title='CSS3 Flexbox information from w3schools' href='https:\/\/www.w3schools.com\/css\/css3_flexbox.asp'>W3Schools<\/a> website says &#8230;<\/p>\n<blockquote cite=''><p>\nThe Flexible Box Layout Module, makes it easier to design flexible responsive layout structure without having to use floats or positioning.\n<\/p><\/blockquote>\n<p> &#8230; and, yes, using the <i>display: flex<\/i> property is much more comprehensive a (CSS styling) concept than the <i>float<\/i> usage options web designers often relied on for this time of styling pre-CSS3.<\/p>\n<p>So, today, to try to show you a bit of how this new Flexbox Layout works, we write a proof of concept HTML and CSS and Javascript (source code file) you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flextest.html_GETME\" title=\"flextest.html\">flextest.html<\/a> offering &#8230;<\/p>\n<ul>\n<li>all the four CSS <i>flex-direction<\/i> property variations (row, row-reverse, column, column-reverse) are offered for user-definement in an HTML select &#8220;dropdown&#8221; element &#8230; and &#8230;<\/li>\n<li>content of the &#8220;parent&#8221; HTML element that Flexbox Layout makes sense to apply to, are also offered for user-definement (with some generic lists, which always reminds me of the genius of Paul Kelly&#8217;s <a target=_blank title='Careless by Paul Kelly lyrics' href='https:\/\/genius.com\/Paul-kelly-careless-lyrics'>Careless<\/a> (whenever I think of lists))<\/li>\n<\/ul>\n<p>Why not try it out with a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flextest.html\" title=\"Click picture\">live run<\/a> link yourself.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d34553' onclick='var dv=document.getElementById(\"d34553\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/css3\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d34553' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d34604' onclick='var dv=document.getElementById(\"d34604\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/table\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d34604' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you were around for the recent CSS3 Flexbox Primer Tutorial and the concept of CSS3&#8217;s &#8230; display: flex; flex-direction: row; \/\/ default, or row-reverse or column or column-reverse &#8230; and this was new to you regarding styling that can &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/css3-flexbox-table-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[281,282,341,3033,564,576,652,997,1991,1075,1212,1238,1319],"class_list":["post-34604","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-css","tag-css3","tag-display","tag-flex","tag-hierarchy","tag-html","tag-javascript","tag-programming","tag-responsive-design","tag-row","tag-styling","tag-table","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/34604"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=34604"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/34604\/revisions"}],"predecessor-version":[{"id":34616,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/34604\/revisions\/34616"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=34604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=34604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=34604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}