Title: INP 140: Day 8
1INP 140 Day 8
2Tables for Data and Positioning
- In web design, we use tables for displaying
data and sometimes for positioning elements on a
page.
3What are tables?
- Tables consist of rows and columns that intersect
to create cells and were originally designed to
give web creators a way to display and organize
charts and data.
4Tables for Data
- One of the primary reasons we put a table into a
website is for presenting data. - If you have ever worked in Microsoft excel or
created a spreadsheet you should be familiar
5Data Tables
- You can easily create a visual representation of
data that is easy to comprehend and read. - Charts
- Spreadsheets
- Grids
- etc
6What is in a table?
- Tables consist of
- Columns
- Cells
- Headings
- Rows
7(No Transcript)
8Example Data Table
9Other examples
HTTP//WWW.PORTAGELAKECOTTAGE.COM http//www.reco
very.gov/?qcontent/investments-agencyhttp//ica
nt.co.uk/csstablegallery/index.php
10Creating a Data Table
- Like adding media, we have a menu option to
INSERT gt MEDIA - Or we have an icon to insert a table
11DEMO
12Doing so gives us the new table box
13Gives us a table
- We can click into a cell, and type into it
14And resize the columns
15The table properties bar
16LAB 6 - Exercise 1
17Tables for positioning
- You may have noticed that up until this point
when we want to alter where an item is positioned
on the page we either choose it to be aligned all
the way to the right, all the way to the left, or
in the dead center.
18Tables for positioning
- If we want to adjust the vertical positioning we
have been hitting enter a bunch of times to space
it out - This is not optimal, we have very little control
over where an item fits on the page.
19Tables for positioning
- At some point someone figured out that you could
use a table as a grid to adjust where an item
is place on the page. - This was done by creating different rows/columns,
adjusting the width/heights, and turning off the
border to make the table invisible.
20Tables
- This because the standard way to create complex
layouts for web sites.
21That example becomes
22This is not ideal
- Any guesses at why this isnt the best way to
make a website?
23Are tables bad?
- Tables have no semantic meaning in relation to
placement. Search engines dont know why an image
is placed in a data cell. - It creates a lot of extra code (longer download
time)
24- Content order gets mixed up, bad for screen
readers. - Now it is recommended that you use CSS (Cascading
Style Sheets) for layout and positioning.
25Tables for layout
- PRO
- Easier to control in a WYSIWYG editor
- Better cross browser compatibility
- Browser manufactures are still working on making
css rendered in a universal manor.
26Tables for layout
- CON
- Not semantically correct
- Longer page load times
- Accessibility Issues
- Maintenance Issues
27What will we be using?
- We will be learning a bit of both, and you can
use what ever you feel most comfortable.
28Using Tables for Layout
- We Adjust the size of the row / column to alter
where the content inside of it will sit.
29Example
WHAT IF WE WANTED TO MOVE THE TEXT SO IT WAS
ALIGNED IN THE CENTER OF THE TWO IMAGES?
30(No Transcript)
31(No Transcript)
32Tables and sizing
- With tables we can adjust the size of the table,
a row, or a column by - Clicking and dragging
- Specifying a pixel width
- Remember not to make it wider than the common
screen resolutions - Specifying a percentage
33If we wanted a 3 column layout
- We could create a table with 3 columns, each one
set at 33 width
34Setting the Table Width
35DEMO
36Selecting Cells vs Selecting the Tables
- Tables consist of several different pieces, and
each one has its own properties - To select a sell, you click inside it
- To select the whole table, you click on a border
- To select a row, you click and drag a whole row
- To select a column you click and drag the whole
column.
37Row Selected
38Column Selected
39Table Selected
40When selected
- When selected, you get different properties that
you can work with regarding the different portion
of the table. - You can adjust the text alignment of a single
cell, or select a whole row and adjust the text
of the row
41DEMO, SELECTING / TEXT ALIGNMENT
42Adding Content To Cells
- We can add content to cells
- Simply click inside a cell
- You can then type in content
- Or insert and image like we have before
- Or even insert media
43DEMO OF ADDING CONTENT
44Lab 2 - Exercise 2
45Merging and Splitting Cells
- What if we want on row to cross all columns?
- We can combine / merge cells so they become
bigger. - This is done by selecting two or more cells, and
clicking the MERGE CELLS button on the property
bar.
46Example
47(No Transcript)
48Splitting a cell
- What if we wanted to divide on cell into two?
- We can click inside that cell, and on the
property bar click the SPLIT CELL icon
49THE CELL IS NOW SPLIT IN TWO
50DEMO MERGING SPLITTING CELLS
51Adding Tables with in Tables
- We can add tables inside of other tables if we
want to - This is called NESTING
52A table with in a table
53This is done by
- Clicking in the cell, and simply clicking the
table icon from the insert bar.
54- The content with in a table cell can be aligned
much like other content.
55This is done by
- Aligning elements with in a cell is done by
clicking on the cell, and setting the alignment
in the property bar
56DEMO WORKING WITH ALIGNMENTS
57Adding Rows / Cells
- Right click on a table, goto the TABLE menu
option. Add row / Add column / Add rows columns
58- Or -
- Modify gt table gt insert row / insert col..etc
59Deleting a row / column
- Select the row column, and hit delete
60Deleting a row / column
- Or select the row / column and go to MODIFY gt
Delete Row / Delete Column
61Lab 6, exercise 3