HTML & XHTML: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
== Margins and paddings on a table ==
== Margins and paddings on a table ==


Margins don't seem to work at all with the table elements (it would work with the table itself, though). Paddings seem to work only with <pre><td></pre> elements, not <pre><tr></pre>.
Margins don't seem to work at all with the table elements (it would work with the table itself, though). Paddings seem to work only with <td> elements, not <pre><tr></pre>.


So the recommended way to specify spacings between elements in a table is through the specific <tt>'border-spacing'</tt> element.
So the recommended way to specify spacings between elements in a table is through the specific <tt>'border-spacing'</tt> element.

Revision as of 11:17, 12 March 2007

Various important things I noticed when writing HTML & CSS code.

HTML

Forms

If you use the GET method on a form, on the action URL, don't give an URL already containing variables encode in GET style. The browser will just rebuild the URL when you submit the form, and thus the variables will be ignored. Eg, something like:

<form action="myurl.html?myVariable=yes&myCounter=3" method="GET"><button type="submit></button></form>

won't work. If you want to pass variables and use a GET method, just create hidden input fields.

CSS

Margins and paddings on a table

Margins don't seem to work at all with the table elements (it would work with the table itself, though). Paddings seem to work only with elements, not

<tr>

.

So the recommended way to specify spacings between elements in a table is through the specific 'border-spacing' element.