Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Created August 6, 2013 11:33
Show Gist options
  • Save ultim8k/6163739 to your computer and use it in GitHub Desktop.
Save ultim8k/6163739 to your computer and use it in GitHub Desktop.
Responsive score table
/**
* Responsive score table
*/
.clearfix:before,
.clearfix:after { content: " "; display: table; }
.clearfix:after { clear: both; }
* { box-sizing: border-box; }
body { font-family: Helvetica; }
.score { text-align: center; }
.data-table { max-width:250px; margin:20px auto; }
.row { background-color: lightgray; border-bottom: 1px solid white; }
.score, .name { width: 50%; float:left; }
.data-left, .data-right { width:45%; float:left; background-color: gray; }
.spacer { width: 10%; float:left; text-align:center; }
.data-right .score { float: left; }
.data-left .score { float: right;}
.data-left .name { float: left; }
.data-right .name { float: right; text-align: right; }
@media (min-width: 480px) {
.mobile { display: none; }
}
<div class="data-table">
<div class="row clearfix">
<div class="data-left">
<div class="name">Name</div><br class="mobile"/>
<input class="score" type="text">
</div>
<div class="spacer">M</div>
<div class="data-right">
<div class="name">Name</div><br class="mobile"/>
<input class="score" type="text">
</div>
</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment