Showing posts with label Table. Show all posts
Showing posts with label Table. Show all posts

Form And Table In HTML

In general, entire form must be completely included into a single table cell (single TD element). For format purpose, one might put form head/declaration outside the table and input items spread over cells. Put entire form with in a table but spread over several rows (TR elements), it will fail.

In addition, if one uses DHTML, form outsider table may not work in some browser, such as IE.

Conclusion: Put entire form completely with in a single table cell will be the best practice.


http://www.cs.tut.fi/~jkorpela/forms/tables.html

Copy Only the Structure of A Table

This old little trick had been asked for so many times. So, it might be a good itea to post it on the blog.

In Oracle:

CREATE TABLE NEW_TAB AS
SELECT *
FROM OLD_TAB
WHERE 0 = -1

In SQL Server:

SELECT *
INTO NEW_TAB
FROM OLD_TAB
WHERE 0 = -1

The key point is WHERE condition. Because this condition is never to be met, so there is no records actually being selected. Someone might like WHERE 1 = 2, however, 1 or 2 can be referred to column one and column two. If by chance the value in column one just equals to column two, haha, you will get some data.

Use getElementById().innerHTML in DHTML

In comparison with document.write(), document. getElementById().innerHTML is very useful because it can be changed after load. However, it cannot be used to insert a row in the table. To do it, it is suggested to insert a complete inner table. Yes, frame your row by an inner table within the table.

Labels