java
html
php
css
xml
ajax
database
linux
regex
silverlight
flash
html5
json
perl
algorithm
cocoa
delphi
apache
mvc
api
You place any tag outside of <tr></tr> tags, it will placed outside your table. Remove the <br /> tags between <tr> tags and your problem will be solved
<tr></tr>
<br />
<tr>
Try removing all the < br > tags
or move the < br > tags inside < td > tags
get rid of the breaks
<table> <tr><td> Subject name:* </td><td> <input type="text" name="subject_name"></td></tr> <tr><td> Code of subject: </td><td> <input type="text" name="subject_code"></td></tr> <tr><td> Description:*</td><td><input type="text" name="descriptions"></td></tr> <tr><td> Teacher:*</td><td><input type="text" name="teacher"></td></tr> <tr><td> Link:</td><td><input type="text" name="href"></td></tr> <tr><td> University:*</td> <td><select id="continent" name="university" onchange="countryChange(this);"> <option value="empty">Select a university</option> <option value="Chech technical university (CVUT)">Chech technical university (CVUT)</option> <option value="Charles university (UK)">Charles university (UK)</option> <option value="MIT">MIT</option> <option value="Harvard">Harvard</option> </select> </tr> </table>
Like t q and Shadow_boi mentioned, take out the <br> tags. Also, your final <td> isn't closed. Something like:
<br>
<td>
<body> <table> <tr> <td> Subject name:* </td> <td> <input type="text" name="subject_name"></td> </tr> <tr> <td> Code of subject: </td> <td> <input type="text" name="subject_code"></td> </tr> <tr> <td> Description:*</td> <td><input type="text" name="descriptions"></td> </tr> <tr> <td> Teacher:*</td> <td><input type="text" name="teacher"></td> </tr> <tr> <td> Link:</td> <td><input type="text" name="href"></td> </tr> <tr> <td> University:*</td> <td> <select id="continent" name="university" onchange="countryChange(this);"> <option value="empty">Select a university</option> <option value="Chech technical university (CVUT)">Chech technical university (CVUT)</option> <option value="Charles university (UK)">Charles university (UK)</option> <option value="MIT">MIT</option> <option value="Harvard">Harvard</option> </select> </td> </tr> </table> </body>
<br> is used to break a line that is a sentence or a sequence of characters as they are aligned horizontally by default. <br> is used to print all the text or characters following it in a new line.In HTML <table> is a tag used to display a table with some contents. <table> should always be followed by <tr> which means you are adding a row into the table. <tr> can be read as starting of new TABLE ROW.Hence once you close this tag as the following code would automatically considered to print from the next line as that row has ended already. <td> is used to give the description part,what should be shown on this new row that is inside a <tr> .Hence is always placed inside a <tr> .You can consider this as a new column,so as many as many columns in that row in that table.Here in this context you have closed </tr> telling the browser to display the other contents in a next line and again you have given a <br> . <br> is not allowed inside a table because of the above explanation hence as you are not using any divisions of forms in the code it is taking those <br> at the starting even before the table is displayed.Hence the four lines space before the table.Try removing the <br> and you will get the expected results.You can also refer t
<table>
TABLE ROW
</tr>
http://www.w3schools.com/tags/tag_br.asp
http://www.w3schools.com/html/html_tables.asp