align and cellpadding

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

Yes.

align and cellpadding

Monarch Reign
William I 1066-1087
William II 1087-1100
Henry I 1100-1135
Stephen 1135-1154

As with images, it is possible to position a table to one side of page and have text fill the remaining space. Do this with the align="right" (as with images) attribute inside the table tag. Of course, you can align the table to the left, as well.

Another useful attribute to include inside the table tag is cellpadding="5". This places 5 pixels of padding around each data item in the table. This was done with the table at right.

Also, as with images, put space between the table and the surrounding text using hspace="10" and vspace="10" (use whatever values you want).

In the following table, experiment with different values for these attributes:

Now click to see what the HTML does.

QUESTION 13:

Can a table have many items per row?