Grid

16 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.96
List Price:  €92.81
You save:  €27.84
£55.77
List Price:  £79.68
You save:  £23.90
CA$95.68
List Price:  CA$136.70
You save:  CA$41.01
A$106.02
List Price:  A$151.47
You save:  A$45.44
S$94.41
List Price:  S$134.88
You save:  S$40.47
HK$546.80
List Price:  HK$781.18
You save:  HK$234.37
CHF 63.34
List Price:  CHF 90.49
You save:  CHF 27.15
NOK kr761.11
List Price:  NOK kr1,087.35
You save:  NOK kr326.23
DKK kr485.02
List Price:  DKK kr692.92
You save:  DKK kr207.89
NZ$116.42
List Price:  NZ$166.33
You save:  NZ$49.90
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,660.01
List Price:  ৳10,943.35
You save:  ৳3,283.33
₹5,835.78
List Price:  ₹8,337.18
You save:  ₹2,501.40
RM331.75
List Price:  RM473.95
You save:  RM142.20
₦86,437.65
List Price:  ₦123,487.65
You save:  ₦37,050
₨19,416.31
List Price:  ₨27,738.77
You save:  ₨8,322.46
฿2,572.74
List Price:  ฿3,675.50
You save:  ฿1,102.76
₺2,264.43
List Price:  ₺3,235.04
You save:  ₺970.61
B$356.70
List Price:  B$509.60
You save:  B$152.89
R1,295.44
List Price:  R1,850.72
You save:  R555.27
Лв127.05
List Price:  Лв181.51
You save:  Лв54.46
₩94,909.58
List Price:  ₩135,590.93
You save:  ₩40,681.35
₪259.50
List Price:  ₪370.74
You save:  ₪111.23
₱3,993.87
List Price:  ₱5,705.78
You save:  ₱1,711.90
¥10,712.31
List Price:  ¥15,303.96
You save:  ¥4,591.65
MX$1,187.89
List Price:  MX$1,697.07
You save:  MX$509.17
QR254.57
List Price:  QR363.69
You save:  QR109.12
P950.82
List Price:  P1,358.38
You save:  P407.55
KSh9,247.76
List Price:  KSh13,211.65
You save:  KSh3,963.89
E£3,352.12
List Price:  E£4,788.95
You save:  E£1,436.83
ብር4,006.43
List Price:  ብር5,723.72
You save:  ብር1,717.28
Kz58,511.64
List Price:  Kz83,591.64
You save:  Kz25,080
CLP$65,950.47
List Price:  CLP$94,219
You save:  CLP$28,268.52
CN¥506.53
List Price:  CN¥723.64
You save:  CN¥217.11
RD$4,055.76
List Price:  RD$5,794.19
You save:  RD$1,738.43
DA9,420.16
List Price:  DA13,457.95
You save:  DA4,037.79
FJ$157.70
List Price:  FJ$225.30
You save:  FJ$67.59
Q542.52
List Price:  Q775.06
You save:  Q232.54
GY$14,601.52
List Price:  GY$20,860.22
You save:  GY$6,258.69
ISK kr9,764.23
List Price:  ISK kr13,949.49
You save:  ISK kr4,185.26
DH703.98
List Price:  DH1,005.73
You save:  DH301.75
L1,236.34
List Price:  L1,766.28
You save:  L529.93
ден3,998.59
List Price:  ден5,712.52
You save:  ден1,713.92
MOP$561.77
List Price:  MOP$802.57
You save:  MOP$240.79
N$1,291.99
List Price:  N$1,845.78
You save:  N$553.78
C$2,569.36
List Price:  C$3,670.67
You save:  C$1,101.31
रु9,319.09
List Price:  रु13,313.56
You save:  रु3,994.46
S/260.54
List Price:  S/372.22
You save:  S/111.67
K269.79
List Price:  K385.44
You save:  K115.64
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,882.68
List Price:  ZK2,689.66
You save:  ZK806.98
L323.40
List Price:  L462.03
You save:  L138.62
Kč1,628.77
List Price:  Kč2,326.92
You save:  Kč698.14
Ft25,305.79
List Price:  Ft36,152.68
You save:  Ft10,846.88
SEK kr755.02
List Price:  SEK kr1,078.64
You save:  SEK kr323.62
ARS$61,468.17
List Price:  ARS$87,815.44
You save:  ARS$26,347.26
Bs483.33
List Price:  Bs690.51
You save:  Bs207.17
COP$271,845.87
List Price:  COP$388,367.89
You save:  COP$116,522.02
₡35,672.25
List Price:  ₡50,962.55
You save:  ₡15,290.29
L1,724.16
List Price:  L2,463.20
You save:  L739.03
₲522,510.75
List Price:  ₲746,475.93
You save:  ₲223,965.17
$U2,674.97
List Price:  $U3,821.56
You save:  $U1,146.58
zł281.37
List Price:  zł401.98
You save:  zł120.60
Already have an account? Log In

Transcript

Hello and this ionic programming tutorial we are going to be looking at the grid system within ionic. If you use any sort of a responsive framework like bootstrap foundation responsive to be free anything along those lines, you'll feel right at home if you haven't simply put there a grid system without hitting ionic Annie allows you to create columns and sizes of elements that are uniform on different devices. So if I had an iPad and I had a column which was 50% width, it will be 50% on the iPad 50% on iPhone 50% on the Nexus five x, etc etc. I think you get the point. So first of all, let's just create a very simple column not as good div what we do know what I go into simply Open this up in a separate text editor because the code in full web or in Xcode is terrible.

So in here, I'm going to put a div. Class of row. This requires this particular class is just not isn't it's not just me adding it, this is what it requires. So this is one unique row. If you have another div, which are in a row, then there'll be a separate line regardless of how much content there is in the previous row. Now in here, you would have diff.

Class equals coal, which is the column on coal, which is a column I'm going to copy and paste that. Still five times saved. Yeah. build our project. So now let's run it. Okay build has succeeded we are launching and now and here we go at the moment is probably not the easiest to demonstrate because we have a background and our text is in the center.

So what we're going to actually do is do style. So we're gonna put some style tags in the head. And in here we are simply going to put dot Cole. We're gonna put text, center text, align, center. We're gonna put no background dash So now I'll start doing Xcode again, I'll switch over in a second. Gray does need to build our projects and now we should be ready to connect as soon as possible.

As you can see we've got individual or while the joint top if you would put a margin or some padding, you would see some individual columns and they are of the same with our recommend training in the iPad simulator or on a real iPad if you have it on different devices. So you can see that they are the same and if I were to add, let's say two more, they would take up less with because there will be seven of them they will be taking up an equal amount of space or Tony have to there will be taken up 50% each Next, we're going to show you explicit column sizing that the moment, depending on the number of columns you have, the column will mean the row width gets divided by that number of columns or the even spacing. But now I'm going to show you how to set width in one column at 50%.

And to call me 25%, that sort of stuff. So we'll do another day. We're going to do save that go to sublime, you'll just be easier. We do it in sublime. So go down here, div, class, row, div. And in the first one class, he calls you by default have to have cold You cannot have called any of coal dash, how much you want your column to span.

So 50 will be 50% but that's how it works. Next, we're going to put div class equals, call us all we're going to be calling is call the copy and paste. And what this will do he'll equally take up the rest of the space but you could have it as 25% as temps and then do five more. So you would take a wall why is that like 15% equaliser be free percentage, try that try doing something along the lines. I've always applied the now 15 here, save it. build our project.

Now let's run it So as you can see this first column span 50% of our grid, and the next two are evenly spaced at 25% each. So the next property we're going to be looking at is off setting columns because at the moment, all the columns have started from the left, but maybe you want a gap of 50%. That's what we're going to be achieving right now. So if we put a div put a class row then put a div class of call, then you put call the actual soul Are your columns on the court? Why should I put on the put 14 on now I'm going to put 50 I'm going to put code dash offset 25. So it's going to start 25% and he's gonna spend 50% of the width.

So it's gonna be from 25 to 75%. Essentially, in here we're gonna put 7525 50 and now we are doing the whole class before coal dotco. If I save that, I will get a pretty darn cool result. So let's just run our project. Okey dokey So, indented essentially by 25%, it has been 50%. And the fine or 25% is taken up equally by this column.

If we were to have two in two afterward after this, they would eat take up 2012 and a half percent. So now we're going to look up vertically aligning columns. So now let's put a div put a class of row div class of column or call for call What we're going to do is copy and paste this. So we have free instances, and directly after we're going to put div class equals coal. Well in here what we're going to do put one, great line to slide three right on for you'll see why in a moment if I were to run this now. So let's just run this in our project.

So we have two column column column 1234. what it's done is the height of these columns is the height of The tallest column for all of these. So that's what I've done so far. What we're going to do now is copy and paste this and very simple. And you can see, let's just do it in sublime. So is the superior editor, copy and paste this. As you can see, these are aligned vertically at the top, what we want them to be aligned, maybe in like a staircase effect, what we can do is add some classes.

So if I were to put co dash top Cole call center cold water. So now let's save that actually, you know what, instead of saving and running out, I'm going to copy I'm just going to show you all the different one that I want to show you. So I'm going to show you another cool one and this is going to be We're going to leave this as it is, imagine if we wanted them all to be in the center, we could just do row center and if we wanted them all at the bottom often you can guess we just do row say we may row dashboard. Save that Nope, gotta get rid of that that T the only the only two teasing bottom when our project or build our project or should say. Now let's run it for Xcode. Okey dokey.

As you can see, we've got a staircase defects over the top center and the bottom we have and the height is adjusted accordingly. We've got the center effect and then we got the box effect. So the last thing I'm going to show you is a responsive grid at the moment, if we could resize this or review it on different screens, they would uniformly be the same. So the free would take up 75% of where if this will take off 50% of the screens will take a look 25%, etc, etc. What you can do is create a responsive grid. So if I were to put a div don't do it in here when do this line disappear editor, but the div class equals row responses dash FM.

Now if I were to do a diff Class equals cold call. Let me copy and paste this. What we've done is created a road where if the screen size is below is smaller than the landscape phone, horizontal form, basically, what it will do is put each one of these columns on an individual line essentially. So let's throw that project and show you what we mean. This is a great way of making it look good on a smaller screen, what you sometimes gain websites and apps less so but especially with web software, we saw we saw it in it. We resolved it to the point of local website, it's still rejoicing in the normal way so things are still taking off 50% instead of going on top of each other as it is on top of each of them have power to go to hardware rotate left is our Not Okay, our app does not support landscape.

So let's just run it and make sure it support land scape. That's good. So what we're going to do is go to sublime we're going to put this one at the top loi. So save that, we're going to put a great line below build our project. And now in Xcode or in a moment, we will run our project so let's run this bad boy in the simulator. It is a switch back and they did and they So this is the landscape Left, Right upside down portrayed.

As you can see they are evenly spaced out now because our screen is not smaller than a landscape form. It's we're at a landscape phone. So let's just honestly get rid of this. We don't want this anymore. Let's run it one more last time so you can see what it look like while it was just in regular portrait mode. Yes, run it.

And as you can see they are on top of each other because we are smaller than a landscape from there. So Is it for grid for the grid system. If you have any questions, feel free to post them on our education platform song or learning Dakota, UK. There'll be a link in the description to that. Plus there will be a nova link to the source code from every video in this series. And as usual, thank you for watching and I hope you have a great day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.