ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

A Web Tutorial Series: Looking at More HTML Structures: Tables, Blocks, Forms & More!

Updated on March 26, 2014

Recap of the Previous Tutorial in the Series

In our previous tutorial, A Web Tutorial Series: The HTML Anchor Tag, More on Problem Solving, & Using Browser Development Tools, we looked primarily at the anchor tag to link our own content and with "outside world" content. As an aside we touched on development tools. My philosophy regarding development and debugging tools is that they should be incorporated throughout the learning process. As a software developer with four decades of experience, I know that you really need to have a basic understanding of where help is available before you run into problems. Studying help doesn't help, knowing there are avenues for solving problems is what is important. With that said, from time to time such "sidebars" will be included in these tutorials.


Scope of This Tutorial and What Will Follow

In this tutorial we return to the structural elements of a page. We will look at tables, forms and blocks. Tables are a great way to visually encapsulate condensed data and they are often what attracts reads to a page. Forms are a mechanism for allowing a web site visitor to interact with the web site creator. With blocks we will start with spans and divs. When first looking at web design, I had no problem understanding spans. What I had problems with were divs. I understood the concept, but I became lost in the implementation. Unfortunately, divs are a legacy and at times seem to be a necessary evil, however with HTML 5 we can get away frim the div-it is of the past with new tags which make a whole lot more sense. So following this introduction to blocks in this tutorial, the next tutorials will concentrate on the new tag: the header, footer, section, aside, nav, etc. which will then precede laying out the page.

Basic Table Structure

A basic table involves the use of four main tags:

  • the <table> and </table> tags which mark the beginning and end of the table
  • the <tr> and </tr> which delineate a row in the table
  • the <td> and </td> which essentially divides the row into columns, the formal name is "data cells"
  • the table can have headings, which can be divided so that specific columns can be identified as to their content. The heading tags are <th> and </th>.

Tables can use other tags. They may include text, images, lists, and other tables. Any valid CSS styling can be applied to the table without restriction.

For an example of how complex a table in HTML may become see the illustration at the footer of this page.

A HTML Table Created from Images of Saturn

It is impressive, but in reality a very simple design consisting of a header and rows of images.
It is impressive, but in reality a very simple design consisting of a header and rows of images.

A Simple Table

An example of a very simple table follows in the snapshot.. It is not pretty as yet but it is functional.

Applying a Little CSS Magic to Our Table

A little CSS magic goes a long way in making even the ordinary stand out.
A little CSS magic goes a long way in making even the ordinary stand out.

A Simple Table: The Alphabet

A simple example using the ,, , and  tags. The only added tag was the  heading tag.
A simple example using the ,, , and tags. The only added tag was the heading tag.

It Doesn't Take Much to Improve This Table

Aout 10 minutes maximum time and this table can look presentable. Other things which can be experimented with could be table size, differnt fornts, different colors and borders.

As we make use of tables in future tutorials we will point out different techniques for improving upon the basic.

The following snapshot show what 10 minutes of effor can accomplish.

Basic HTML Form Structure

HTML5 adds a whole new dimension to forms with a host of new input types, form elements and attributes. The additions will cover several tutorials in the future. Rather than be overwhelmed now we will just look at the basic construction of a form.

A form serves a significant purpose in web design and construction. A form allows a user (a client) to communicate with some server application.

The outline of a form consists of the <form></form? tags.Within the form tags one can have text fields, radio-buttons and checkboxes, submit buttons, password fields and more. The following illustrates the form elements.

The Input Element: The Most Important Form Element

The most imprtant element on a form is the input element. The input element is the way the user of the page select what actions the y wich to perform.The input element tag is a self-closing tage. <input>

The following snapshot illustrates a simple login form. In our illustration we will use two types of input. A text input for the user name and a password type input for the users password. A password type input differs from a text input in that it masks out the data being entered.

The Input Text and Input Password Elements

Data is accepted to both the username and password  field boxes. Notice that the password name as it is type is masked out. The form does nothing but allow text entry at this point.
Data is accepted to both the username and password field boxes. Notice that the password name as it is type is masked out. The form does nothing but allow text entry at this point.

The Submit Button - Makes it Happen

The submit button is what makes if not "the world go 'round" at least directs the data a a server application. This is beyond the scope of this tutorial. The coding of the submit button itself is rather simple. It involves the <input> tag with a type specification of submit and a value field which indicates the what information is placed on the button.

For processing of the data changes are made to the form element itself. The submit button merely triggers the form action.

The Form Example Updated with the Submit Button

After filling in the form if the submit button is clicked data is sent to the server based on the action and method attributes specified in the form element.
After filling in the form if the submit button is clicked data is sent to the server based on the action and method attributes specified in the form element.

Two Other Basic Input Mechanisms

The final two basic methods of input we will consider here are the checkbox and radio button types. They differ in appearance. The are also distinguished in that radio buttons permit the selection of only one option while checkboxes permit no selection or multiple selections. The snapshots which follow illustrate the use of both.

The Checkbox and Radio Button Input Types

Illustrating the different way in which check boxes and radio buttons are formatted.
Illustrating the different way in which check boxes and radio buttons are formatted.

Introduction to Blocks

This is just the beginning and it becomes critical in creating web pages: the understing of the difference between HTML block elements and HTML inline elements.

Most HTML elements are defined as block elements. They are stacked on top of one another.: headers <h1> through <h6> , <tables>, and <p> for example.

Inline elements are arraged vertically. They don't "stack".

The two elements we discuss now are the<div> element and the <span> element. The <div> eleent is a block element. Yhe <span> element is a inline element.

Now, come the hard part. Neither the <div> nor the <span> have any special meaning.. It is what you make out of them. They are merely containers. In versions before HTML 5 <divs> became notorious in creating confusion with their use. With HTML 5 with more element types to choose from it has become easier to style pages and get away from divs.

Here's a final way in which to begin to comprehend <span> and <div>. If I have one word in a paragraph which for some reason I want displayed in the color red, I would use a <span> with the color style specified. This is an inline use. If I have a block of text to which I want to specify a specific styling to, I would use a <div>, As noted, with HTML5 and its additional element types, I might be able syle elements rather than style a <div>.We will revisit this discussion againg as there are many legacy pages which are "over<div>'ed"

A HTML Rendering of the Chemical Periodic Table

This table was constructed using HTML and CSS.The tedious part was in placement of the elements and getting the right color, border, and technical data correct.
This table was constructed using HTML and CSS.The tedious part was in placement of the elements and getting the right color, border, and technical data correct.

Wrap Up and What's Next

In this tutorial we looked at significant HTML block elements: tables and forms. We touched on the notions of block and inline structures and briefly discussed <div>'s and <span>'s which were the only ways of making styling more specific with the limited number of HTML element types in earlier versions of the product.

In our next tutorial we will begin looking at some of the new HTML 5 element types a s we work toward a goal of structuring our content in an effective manner so that when we apply styling we will have elegant web pages and web sites.

Please Rate this Tutorial on Its Content

5 out of 5 stars from 1 rating of Was this a useful tutorial?
working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)