Table rows are the horizontal elements of the table grid and are delimited with table row tags (<tr>). For example, a table with five rows would use the following pseudocode:
Possible Rules Attribute Values
The rows are divided into individual cells by embedded <td> or <th> tags (see the next section, “Cells,” for more details).
Note The row ending tag (</tr>) is optional. However, for clarity in your code you should consider always including appropriate ending tags. The <tr> tag supports the following attributes.
For an example of how baseline vertical alignment differs from bottom alignment, consider the two tables.
Baseline alignment aligns the baseline of the text.
If you use the alignment attributes in a <tr> tag, that alignment will be applied to all cells in that row. To format cell alignment individually, specify the alignment attribute(s) in individual cell tags (<th> or <td>) or in <col> or <colgroup> tags.
Note The bgcolor attribute, used to set the background color for the row, has been deprecated in HTML 4.01. Instead of using this attribute, it is recommended that you use applicable styles to accomplish the same effect.
Individual cells of a table are the elements that actually hold data. In HTML, cell definitions also define the columns for the table. You delimit cells/columns with table data tags (<td>).
For example, consider the following code:<table border=“1” cellpadding=“5”>
Tip Formatting your tables with ample white space (line breaks and indents) will help you accurately format and understand your tables. There are just as many ways to format a table in HTML as there are Web programmers—find a style that suits your taste and stick to it. This code defines a table with two rows and three columns, due to the three sets of <td> tags.
You can also use table header tags (<th>) to define columns that are headers for the columns. Expanding on the previous example, the following adds column headers:<table border=“1” cellpadding=“5”>
Table header tags make it easy to format column headings, without having to result to character formatting. For example, the preceding code results in most user agents rendering the <th> cells in a bold font (the default for <th>). To accomplish the same formatting without header tags, you would need to include bold character formatting similar to the following:<tr>
Using CSS, your formatting options with <th> are practically limitless; simply define appropriate formatting or several formatting classes as necessary.
Note Most user agents will not properly render an empty cell (for example, <td></td>). When you find yourself needing an empty cell, get in the habit of placing a nonbreaking space entity ( ) in the cell (for example, <td> </td>) to help ensure the user agent will render your table correctly. Although cells represent the smallest element in a table, surprisingly, they have the most attributes for their tags.
Note Previous versions of HTML also supported a nowrap attribute to control whether a cell’s contents wrapped or not. In HTML 4.01, this attribute has been deprecated in favor of styles.
HTML Related Interview Questions
|XML Interview Questions||HTML 4 Interview Questions|
|HTML Interview Questions||HTML 5 Interview Questions|
|HTML DOM Interview Questions||Java Interview Questions|
|CSS Interview Questions||Java Abstraction Interview Questions|
|Dynamic HTML Interview Questions||XHTML Interview Questions|
Introducing The Web And Html
What Goes Into A Web Page?
Starting Your Web Page
Lines, Line Breaks, And Paragraphs
Page Layout With Tables
Introducing Cascading Style Sheets
Creating Style Rules
Padding, Margins, And Borders
Colors And Backgrounds
Tables Table Styles
Defining Pages For Printing
Dynamic Html With Css
Introduction To Server-side Scripting
Introduction To Database-driven Web Publishing
Creating A Weblog
Introduction To Xml
Xml Processing And Implementations
Testing And Validating Your Documents
Choosing A Service Provider
Uploading Your Site With Ftp
Publicizing Your Site And Building Your Audience
Maintaining Your Site
The Web Development Process
Developing And Structuring Content
Designing For Usability And Accessibility
Designing For An International Audience
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.