Web Programming with HTML, XHTML, and CSS Second Edition- P4
Số trang: 50
Loại file: pdf
Dung lượng: 830.49 KB
Lượt xem: 17
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Web Programming with HTML, XHTML, and CSS Second Edition- P4: Điều này bắt đầu hướng dẫn nhận xét HTML và cũng giới thiệu đến bạn bằng cách sử dụng XHTML cho cấu trúc của một trang web và cascading style sheets (CSS) để kiểm soát như thế nào một tài liệu sẽ xuất hiện trên một trang web. Bạn se tìm hiểu làm thế nào để tận dụng lợi thế của các tính năng mới của các trình duyệt trong khi đảm bảo rằng các trang của bạn vẫn làm việc ở cũ, nhưng phổ biến, các trình duyệt. Bằng...
Nội dung trích xuất từ tài liệu:
Web Programming with HTML, XHTML, and CSS Second Edition- P4 Chapter 4: TablesThe height Attribute (deprecated) The height attribute allows you to specify the height of a cell in pixels or as a percentage of the available space: height=”20” or height=”10%”The nowrap Attribute (deprecated) The nowrap attribute is used to stop text from wrapping onto a new line within a cell. You would use nowrap only when the text really would not make sense if it were allowed to wrap onto the next line (for example a line of code that would not work if it were spread across two lines). In HTML it was used with- out an attribute value, but that would not be allowed in Transitional XHTML. Rather, you would use the following: nowrap=”nowrap”The rowspan Attribute The rowspan attribute specifies the number of rows of the table a cell will span across, the value of the attribute being the number of rows the cell stretches across. (See the example in the section “Spanning Rows Using the rowspan Attribute” later in this chapter.) rowspan=”2”The scope Attribute The scope attribute can be used to indicate which cells the current header provides a label or header information for. It can be used instead of the headers attribute in basic tables, but does not have much support: scope=”range“ The table that follows shows the possible values of the attribute. Value Purpose row Cell contains header information for that row. col Cell contains header information for that column. rowgroup Cell contains header information for that rowgroup (a group of cells in a row created using the , , or elements). colgroup Cell contains header information for that colgroup (a group of columns created using the or element, both of which are discussed later in the chapter). 121Chapter 4: TablesThe valign Attribute (deprecated) The valign attribute allows you to specify the vertical alignment for the content of the cell. Possible values are top, middle, bottom, and baseline, each of which is discussed more in the “The valign Attribute” section within the “The Element Contains Table Rows” section earlier in the chapter.The width Attribute (deprecated) The width attribute allows you to specify the width of a cell in pixels or as a percentage of the available space: width=”150” or width=”30%” You need to specify only the width attribute for the cells in the first row of a table, and the rest of the rows will follow the first row’s cell widths. If you specify a width attribute for the element, and the widths of individual cells add up to more than that width, most browsers will squash those cells to fit them into the width of the table. You can also add a special value of *, which means that this cell will take up the remaining space available in the table. So if you have a table that is 300 pixels wide, and the first two cells in a row are specified as being 50 pixels wide, if the third cell has a value of * it will take up 200 pixels — the remaining width of the table. If the width of the table had not been specified, then the third column would take up the remain- ing width of the browser window. It is worth noting that you cannot specify different widths for elements in corresponding columns of different rows of a table. So, if the first row of a table had three elements whose widths are 100 pixels, the second row could not have one element whose width was 200 pixels and two that are 50 pixels.Try It Out An Accessible Timetable In this example you create a timetable that is specifically designed to be accessible for those with visual impairments. Because you are likely to come across them in the real world, the example will contain some deprecated attributes. 1. Because this example contains deprecated attributes, you need to set up the skeleton ready to handle a Transitional XHTML 1.0 document: An accessible timetable 122 Chapter 4: Tables2. Next you can add in the main elements required to create a table with three rows and three columns. The left-most column and the top row will contain headings. While you are doing this, you’ll add in some content for the table, too. The timetable will show a fictional weekend course on XHTML, with morning and afternoon sessions for Sa ...
Nội dung trích xuất từ tài liệu:
Web Programming with HTML, XHTML, and CSS Second Edition- P4 Chapter 4: TablesThe height Attribute (deprecated) The height attribute allows you to specify the height of a cell in pixels or as a percentage of the available space: height=”20” or height=”10%”The nowrap Attribute (deprecated) The nowrap attribute is used to stop text from wrapping onto a new line within a cell. You would use nowrap only when the text really would not make sense if it were allowed to wrap onto the next line (for example a line of code that would not work if it were spread across two lines). In HTML it was used with- out an attribute value, but that would not be allowed in Transitional XHTML. Rather, you would use the following: nowrap=”nowrap”The rowspan Attribute The rowspan attribute specifies the number of rows of the table a cell will span across, the value of the attribute being the number of rows the cell stretches across. (See the example in the section “Spanning Rows Using the rowspan Attribute” later in this chapter.) rowspan=”2”The scope Attribute The scope attribute can be used to indicate which cells the current header provides a label or header information for. It can be used instead of the headers attribute in basic tables, but does not have much support: scope=”range“ The table that follows shows the possible values of the attribute. Value Purpose row Cell contains header information for that row. col Cell contains header information for that column. rowgroup Cell contains header information for that rowgroup (a group of cells in a row created using the , , or elements). colgroup Cell contains header information for that colgroup (a group of columns created using the or element, both of which are discussed later in the chapter). 121Chapter 4: TablesThe valign Attribute (deprecated) The valign attribute allows you to specify the vertical alignment for the content of the cell. Possible values are top, middle, bottom, and baseline, each of which is discussed more in the “The valign Attribute” section within the “The Element Contains Table Rows” section earlier in the chapter.The width Attribute (deprecated) The width attribute allows you to specify the width of a cell in pixels or as a percentage of the available space: width=”150” or width=”30%” You need to specify only the width attribute for the cells in the first row of a table, and the rest of the rows will follow the first row’s cell widths. If you specify a width attribute for the element, and the widths of individual cells add up to more than that width, most browsers will squash those cells to fit them into the width of the table. You can also add a special value of *, which means that this cell will take up the remaining space available in the table. So if you have a table that is 300 pixels wide, and the first two cells in a row are specified as being 50 pixels wide, if the third cell has a value of * it will take up 200 pixels — the remaining width of the table. If the width of the table had not been specified, then the third column would take up the remain- ing width of the browser window. It is worth noting that you cannot specify different widths for elements in corresponding columns of different rows of a table. So, if the first row of a table had three elements whose widths are 100 pixels, the second row could not have one element whose width was 200 pixels and two that are 50 pixels.Try It Out An Accessible Timetable In this example you create a timetable that is specifically designed to be accessible for those with visual impairments. Because you are likely to come across them in the real world, the example will contain some deprecated attributes. 1. Because this example contains deprecated attributes, you need to set up the skeleton ready to handle a Transitional XHTML 1.0 document: An accessible timetable 122 Chapter 4: Tables2. Next you can add in the main elements required to create a table with three rows and three columns. The left-most column and the top row will contain headings. While you are doing this, you’ll add in some content for the table, too. The timetable will show a fictional weekend course on XHTML, with morning and afternoon sessions for Sa ...
Tìm kiếm theo từ khóa liên quan:
phương pháp lập trình lập trình web với html ngôn ngữ lập trình html lập trình xhtmlTài liệu liên quan:
-
Giáo trình Lập trình logic trong prolog: Phần 1
114 trang 197 0 0 -
Giáo trình Lập trình C căn bản
135 trang 172 0 0 -
Giáo trình Lập trình C căn bản: Phần 1
64 trang 170 0 0 -
14 trang 135 0 0
-
Giáo trình lập trình hướng đối tượng - Lê Thị Mỹ Hạnh ĐH Đà Nẵng
165 trang 115 0 0 -
Bài giảng Phương pháp lập trình: Chương 9 - GV. Từ Thị Xuân Hiền
36 trang 113 0 0 -
Giáo trình về môn Lập trình C căn bản
131 trang 50 0 0 -
Bài giảng Lập trình hướng đối tượng (dùng JAVA): Chương 1 - Trần Minh Thái
40 trang 41 0 0 -
PHP: The Good Parts: Delivering the Best of PHP- P5
20 trang 37 0 0 -
Bài giảng Lập trình căn bản - Trường CĐ Công nghệ và Nông Lâm Nam Bộ
219 trang 28 0 0