+ All Categories
Home > Documents > HTML Tables. Start of page where we want to place a table.

HTML Tables. Start of page where we want to place a table.

Date post: 15-Jan-2016
Category:
Upload: silas-hawkins
View: 215 times
Download: 0 times
Share this document with a friend
Popular Tags:
38
HTML Tables
Transcript
Page 1: HTML Tables. Start of page where we want to place a table.

HTML Tables

Page 2: HTML Tables. Start of page where we want to place a table.

Start of page where we want to place a table

Page 3: HTML Tables. Start of page where we want to place a table.

Design View of Page Start

Page 4: HTML Tables. Start of page where we want to place a table.

Table we want to add to our page.

Page 5: HTML Tables. Start of page where we want to place a table.

In Design View go to Table/Insert Table

Page 6: HTML Tables. Start of page where we want to place a table.

Choose number of rows and columns. Click OK.

Page 7: HTML Tables. Start of page where we want to place a table.

Table code generated

Page 8: HTML Tables. Start of page where we want to place a table.

Table tags

• The <table> tag indicates the beginning of a table

• The <tr> tag indicates the beginning of a row.• The <td> tag indicates the beginning of a cell• Not used yet, the <th> tag indicates a header

cell

Page 9: HTML Tables. Start of page where we want to place a table.

Non-breaking space

• The code &nbsp; gives one a non-breaking space. It’s a space but it will not allow breaking, i.e. returning to the next line on the page if the line is long.

• The table generated has non-breaking spaces in the <td> table data elements (cells) so that they are not empty. Empty cells may be rendered differently from cells with content.

Page 10: HTML Tables. Start of page where we want to place a table.

Merge the cells in the first row by highlighting them (in design) and going to Table/Modify/Merge Cells

Page 11: HTML Tables. Start of page where we want to place a table.

The colspan attribute that arose from merging the cells

One cell now spans all eight columns of the table

Page 12: HTML Tables. Start of page where we want to place a table.

Merge the second row. Enter the text between the open and close tag. Switch the tags from <td> to <th>

Page 13: HTML Tables. Start of page where we want to place a table.

Design View with the first two rows merged and switched to <th>

Page 14: HTML Tables. Start of page where we want to place a table.

Enter the data for the third row which is also <th>’s.

Page 15: HTML Tables. Start of page where we want to place a table.

Enter the rest of the data

Page 16: HTML Tables. Start of page where we want to place a table.

Style code to left justify the header text

Page 17: HTML Tables. Start of page where we want to place a table.

Code to make top header have gray background and white font color

We don’t want to style all of the headers but just the top one. There are several ways to this this. 1.Apply an inline style to the particular <th>2.Define the style for a class and set the <th>’s class attribute to that value (allows more than one item to have that style)3.Define the style for an item with a particular id and set the <th>’s id attribute to that value

Page 18: HTML Tables. Start of page where we want to place a table.

Similarly, make a class for the second header

Page 19: HTML Tables. Start of page where we want to place a table.

Comparison of original and ours with header styles

Page 20: HTML Tables. Start of page where we want to place a table.

Establish a class for odd rows that gives them a light gray background and set the class property of the odd rows to “odd”

Page 21: HTML Tables. Start of page where we want to place a table.

Comparison of original and ours with “odd” rows providing gray background

Page 22: HTML Tables. Start of page where we want to place a table.

Some font adjustments

Page 23: HTML Tables. Start of page where we want to place a table.

Comparison of original and ours with font adjustments

Page 24: HTML Tables. Start of page where we want to place a table.

To eliminate the gaps surrounding the table cells, set the table’s cellspacing to 0px.

Page 25: HTML Tables. Start of page where we want to place a table.

W3 on cellspacing and cellpadding (the border if there is one falls between the spacing and the paddding)

Page 26: HTML Tables. Start of page where we want to place a table.

Comparison of original and ours with cellspacing set to zero (no more gaps)

Page 27: HTML Tables. Start of page where we want to place a table.

Using a border to place a “gap” between first and second rows

Page 28: HTML Tables. Start of page where we want to place a table.

Comparison of original and ours with border added to first row (bring back one gap)

Page 29: HTML Tables. Start of page where we want to place a table.

Add some padding to the header cells

Page 30: HTML Tables. Start of page where we want to place a table.

Comparison of original and ours with padding added to header cells

Page 31: HTML Tables. Start of page where we want to place a table.

Making the player names hyperlinks

Page 32: HTML Tables. Start of page where we want to place a table.

Hyperlinks with default style: underlined blue for visited and purple for visited. Real site no underline and red if you hover over it.

Page 33: HTML Tables. Start of page where we want to place a table.

Code to eliminate default underline style of hyperlink.

Page 34: HTML Tables. Start of page where we want to place a table.

Result with hyperlinks no longer underlined

Page 35: HTML Tables. Start of page where we want to place a table.

Code to make color blue except when hovered over when it turns red

Page 36: HTML Tables. Start of page where we want to place a table.

Result: Mouse is over Dalembert

Page 37: HTML Tables. Start of page where we want to place a table.

Attribute to add to make a new page arise in addition to old page, instead of new page replacing the old page

Page 38: HTML Tables. Start of page where we want to place a table.

Another way to style even and odd rows – doesn’t work in Internet Explorer (?)


Recommended