HTML & CSS- part 8 Flashcards
Tables sometimes put spaces between the cells. You may only notice this if you’re using a border.
How do you get rid of these spaces?
table {
border-collapse: collapse;
}
How do you add spaces between each cell, whether or not there are visible borders?
table {
border-spacing: 3m;
}
What’s the difference between setting the width for <table> and the width for <th> or <td>?
For <table>, the percentage is of the WHOLE PAGE OR DIV
But for <th> or <td>, the percentage is of the TABLE, not the page/div.
What are the options for horizontal alignment in a table? (Or elsewhere)
text-align: left, right, center, justify;
What are the options for vertical alignment in a table?
vertical-align: top, center, bottom;
Which kind of element does vertical-align not work in?
<table>
Instead, you have to do it direcdtly for <th> and <td>
What’s the default horiz. alignment for <td>?
<td> default alignment is left
What’s the default horiz. alignment for <th>?
<th> default alignment is center
What’s the default vertical alignment for both <td> and <th>?
Vertical alignment default for both <td> and <th> is center
What’s a nice way to make the rows stand out?
background-color:
What are the attributes of a <form> tag?
action
method
In a <form> tag, what does the attribute “action” do?
“action” tells the browser what to do with the info typed into the form.
In the case of “send-email.php”, this might send an email to the site owner that includes the data the user has entered.
Or a program might write the data entered by the user to a database on the server.
Or a program might process credit card information entered in a form.
There are all kinds of programs, written in various languages, that can process data from a form. The languages include PHP, Ruby, Python, Perl, Java, and C#.
In a <form> tag, what does the attribute “method” do?
Indicates HOW to process the information from the form
What are the two options for “method” in a <form> tag?
method=”post”
This is the one you use to process more than a little bit of information
Use it when you want to keep the information secure.
method=”get”
This is used mostly for search forms.
You know a form is using the get method when the information entered in the form (connected by plus signs) appears in the URL after you click Submit.
What’s the basic structure of a <form> tag with its controls?
<form>
form elements such as
text
textarea
submit buttons,
radio buttons
checkboxes
select box, etc.
</form>