Você está na página 1de 3

vertical-align: bottom;

Table Style
Table Borders
Slide HTML01
table, th, td {
border: 1px solid black;
}

Collapse Borders
table {
border-collapse: collapse;
}

Table Width and Height


table, th, td {
border: 1px solid black;
}

Horizontal Text Alignment


th {
text-align: left;
}

Table Padding
td {
padding: 15px;
}

Table Color
table, td, th {
border: 1px solid green;
}
th {
background-color: green;
color: white;
}

Vertical Text Alignment


td {
height: 50px;

<iframe width="560" height="315"


src="https://www.youtube.com/embed/spseKv7jt
mY" frameborder="0" allowfullscreen></iframe>
<meta charset="utf-8">
.intro:hover {
background-color: #505050;
}

Form
<form>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>

<form>
<input type="radio" name="sex" value="male"
checked>Male
<br>
<input type="radio" name="sex" value="female">Female
</form>

<form action="action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>

Method Attribute
<form action="action_page.php" method="get">
<form action="action_page.php" method="post">
When to Use GET?
You can use GET (the default method):
If the form submission is passive (like a search engine query),
and without sensitive information.
When you use GET, the form data will be visible in the page
address: action_page.php?
firstname=Mickey&lastname=Mouse
GET is best suited to short amounts of data. Size limitations
are set in your browser.

When to Use POST?


You should use POST:
If the form is updating data, or includes sensitive information
(password).
POST offers better security because the submitted data is not
visible in the page address.
The Name Attribute
To be submitted correctly, each input field must have a name
attribute.
This example will only submit the "Last name" input field:
<form action="action_page.php">

First name:<br>
<input type="text" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>
Grouping Form Data with <fieldset>
The <fieldset> element groups related data in a form.
The <legend> element defines a caption for the <fieldset>
element.
<form action="action_page.php">
<fieldset>
<legend>Personal information:</legend>
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</fieldset>
</form>

Tic Tac Toe


<!doctype html>
<html>
<head>
<title>Tic Tac Toe</title>
<meta name="viewport" content="width=600px" />
</head>
<body >
<h1>TicTacToe</h1>
<table id="papan" border = 1 height="200px" width = "200px"
style="text-align:center;table-layout:fixed">
<tr>
<td id="0" onclick="gamePlay(0)"></td>
<td id="1" onclick="gamePlay(1)"></td>
<td id="2" onclick="gamePlay(2)"></td>
</tr>
<tr>
<td id="3" onclick="gamePlay(3)"></td>
<td id="4" onclick="gamePlay(4)"></td>
<td id="5" onclick="gamePlay(5)"></td>
</tr>
<tr>
<td id="6" onclick="gamePlay(6)"></td>
<td id="7" onclick="gamePlay(7)"></td>
<td id="8" onclick="gamePlay(8)"></td>
</tr>
</table>
<script>
var player = 1;
function gamePlay(id){
//put your code here
var x = document.getElementById(id);
if(x.innerHTML==''){
if(player==1){
x.innerHTML = "<span style='color:blue'>X</span>";
player=2;
}
else{
x.innerHTML = "<span style='color:red'>O</span>";
player=1;
}
}
}
</script>
</body>
</html>

JQUERY
<script type="text/javascript" src="jquery1.11.3.min.js"></script>
$(document).ready(function() {
canvas = $("#myCanvas");

context = canvas.get(0).getContext("2d");
canvas.attr("width",$
(window).get(0).innerWidth-300);
canvas.attr("height", $
(window).get(0).innerHeight-10);
canvasWidth = canvas.width();
canvasHeight = canvas.height();

window.addEventListener("keydown",function(e){
keysDown[e.keyCode] = true;
});
window.addEventListener("keyup",function(e){
delete keysDown[e.keyCode];
});
});

Você também pode gostar