Table Styling.

Slides:



Advertisements
Similar presentations
Client-Side Internet and Web Programming
Advertisements

Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
CSS provides a way to stray away from the traditional methods of using tables to lay out pages. Success with this technique depends on understanding of.
Tutorial 4: Creating page layout with css
CSS. What does it stand for? Cascading Style Sheets.
1 Lesson Style Sheets Box Model Content (text,image,table) Margin Padding Border Box.
4.01 Cascading Style Sheets
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSS Border.
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
Part 4 Introduction to CSS. CSS Table Table Borders table, td, th { border:1px solid black; } Firstname Lastname Bader Ali Paul Manuel The example below.
Web Foundations THURSDAY, OCTOBER 3, 2013 LECTURE 6: CSS CONTINUED.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
Table Styling. Using CSS to Style Tables: So far, our table styling - such has "width" and "border" - has not used CSS. CSS provides us with many tools.
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
CSS Table Styling. Up to this point, as we haven't applied any CSS styling to our tables, our example tables have not been too pleasing to the eye. CSS.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
CSS. What does it stand for? ___________________.
CSS. What does it stand for? Cascading Style Sheet.
WebD Introduction to CSS By Manik Rastogi.
CSS Box Model.
CSS Box Model.
Chapter 6 - Cascading Style Sheets™ (CSS)
CSS Box Model.
The Box Model in CSS Web Design – Sec 4-8
Cascading Style Sheets Boxes
4.01 Cascading Style Sheets
( Cascading style sheet )
Table Styling.
CSS Table Styling.
Semester - Review.
The Box Model in CSS Web Design – Sec 4-8
Applying CSS to Tables Stylish Tables.
Table Styling.
Unit 3 - Review.
Creating Your Own Webpage
>> The “Box” Model
Tutorial 5 Working with Tables and Columns
The Box Model in CSS Web Design – Sec 4-8
CSS Applications to XML 19-Sep-18.
CSS Table Styling.
CSS Table Styling.
Objectives Create a reset style sheet Explore page layout designs
Creating Layouts Using CSS
Cascading Style Sheets
Table CSS Create a new CSS called tablestyle.CSS Green Background
The Internet 10/13/11 The Box Model
CSS Borders and Margins.
Second CSS Lecture Applications to XML
CSS Box Model.
More CSS Page layout Boriana Koleva Room: C54
How to use the CSS box model for spacing, borders, and backgrounds
More CSS 22-Feb-19.
The Box Model.
CSS Box Model.
Principles of Web Design 5th Edition
CSS Boxes CS 1150 Fall 2016.
CS3220 Web and Internet Programming More CSS
4.01 Cascading Style Sheets
CSS Box Model.
CSS Box Model.
CSS Applications to XML 20-May-19.
CS3220 Web and Internet Programming More CSS
CSS Applications to XML 3-Jul-19.
CGS 3066: Web Programming and Design Fall 2019 CSS Part 2
CS3220 Web and Internet Programming More CSS
Presentation transcript:

Table Styling

Using CSS to Style Tables: So far, our table styling - such has "width" and "border" - has not used CSS. CSS provides us with many tools to style our tables, again with the advantage of being able to make multiple changes to a page with a single edit in the <style> section of the document.

Common Table Styles: Style Description width Width of table or row. background-color Background color of table, row or cell. color Color of text in table, row, or cell. text-align Text alignment in table, row or cell. border Border of table, row, or cell. padding Padding of table, row, or cell. You are already familiar with the first four styles listed here. We have used them for other elements, such as <p>, <h1>, <li>, and <a>.

More About Borders: Style Description border-width Width of border around table, row, or cell. Measured in pixels. Also available are: thin, medium, and thick. A value of "0" displays no border. border-color Color of border around table, row, or cell. border-style Type of border to display: solid, dashed, dotted, groove, ridge, inset, outset. border-collapse Collapses double lines around cells into one line. The border-style and border-color properties can be defined for specific sides: Specifying 1 value = style applies to all four sides. Specifying 2 values = first applies to top and bottom, second applies to left and right. Specifying 3 values = first applies to top, second applies to right and left, third applies to bottom. Specifying 4 values = applies to top, right, bottom, left respectively.

Example Border: Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 <head> <style type="text/css"> table { width:200px; border-width:3px; border-color:red; border-style:solid dashed dotted; } </style> </head> <body> <table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <td>Cell 3</td> <td>Cell 4</td> <td>Cell 5</td> <td>Cell 6</td> </table> </body> Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 Here we have defined the width of the table, the thickness of the border, the color of the border, and the style of the border.

Using the Border Shorthand Property: <head> <style type="text/css"> table { width:200px; border:3px dashed red; } </style> </head> <body> <table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <td>Cell 3</td> <td>Cell 4</td> <td>Cell 5</td> <td>Cell 6</td> </table> </body> Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 We also have the option to use shorthand when specifying the border properties. The syntax is border:border-width border-style border-color; This shorthand can be used only when the border style and color are uniform for top, left, bottom, and right.

Using CSS Classes to Style Tables: The power of CSS classes can be used when styling tables. For example, we can used two different classes to alternate background colors for table rows, making our table easier to read (much like the tables used in earlier slides).

Using Classes to Style Tables: <head> <style type="text/css"> table { width:200px; border:3px solid black; } tr.odd { background-color:yellow; tr.even { background-color:lightblue; </style> </head> <body> <table> <tr class="odd"> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr class="even"> <td>Cell 3</td> <td>Cell 4</td> <td>Cell 5</td> <td>Cell 6</td> </table> </body> Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 By alternating the classes "odd" and "even", we have made it easier for our web visitors to read the table rows.