Basic HTML help?
I'll be honest, I do not know much about HTML. I don't really mess with rowspans/colspans, because I use photoshop to do most of my coding :S
(I do the basic web in photoshop cs3, save for web, and edit the code from there.)
Here's something in the middle of the script (this is the index)
---
<td colspan="4">
<img src="images/index_13.gif" width="288" height="127" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="127" alt=""></td>
</tr>
<tr>
<td rowspan="9">
<img src="images/index_14.gif" width="21" height="911" alt=""></td>
<td colspan="4" rowspan="9" valign="top">
<font color="#E0EEF4"> Coming soon~</font>
</td>
And I want to add something in here, something that uses a table. (Like this:)
<TABLE BORDER="1" BGCOLOR="#4EA5E8">
<TR>
<TH>Title</TH>
</TR>
<TR>
<TD><a href="/title.php">This is the title</TD>
When I put that in, of course the page gets messed up.
Any way I can do this properly? (I really prefer doing a php include)
Public Comments
- First off you should be using CSS for this and not HTML. Both the BGCOLOR and the font color tags have been deprecated for a long time now. I would highly recommend you take the time to learn (x)HTML and CSS it is not that hard to learn nor is it very time consuming to learn either. Photoshop is not a web authoring software you should be using dreamweaver and putting your images into your pages in the code view. After all they are made by the same company (Adobe) now. You should be using CSS for all your positioning as well as determining things like font-family, font-color, background-color and how you want your elements to be displayed. (x)HTML is only for the basic structure things like the actual paragraphs,spans divs, and body tags
- I've read your question and Kevin's answer. He is right. He has told almost everything I would have told you. I only add a php code as you prefer doing a php include. This is very handy. This code creates table dynamically. <html> <head></head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Enter number of rows <input name="rows" type="text" size="4"> and columns <input name="columns" type="text" size="4"> <input type="submit" name="submit" value="Draw Table"> </form> <?php if (isset($_POST['submit'])) { echo "<table width = 90% border = '1' cellspacing = '5' cellpadding = '0'>"; // set variables from form input $rows = $_POST['rows']; $columns = $_POST['columns']; // loop to create rows for ($r = 1; $r <= $rows; $r++) { echo "<tr>"; // loop to create columns for ($c = 1; $c <= $columns;$c++) { echo "<td> </td> "; } echo "</tr> "; } echo "</table> "; } ?> </body> </html> As you'll see if you try coding the same thing by hand, PHP's for() loop just saved you a whole lot of work! And it looks good too - take a look at the source code of the dynamically generated table, and you'll see that it's nicely formatted, with line breaks at the end of every table cell and row. This magic is accomplished by forcing a carriage return with in every call to echo(). Hope that your interest in web development will increase and you will use html with css and of course php. Best of luck.
- Tables are not meant for layout, but for tabular data. The reason you should not use tables for layout is that reading software used by the blind and others gets confused, and that makes the page inaccessible to them, which is illegal in the UK, most of Europe and I believe in the US as well.
Powered by Yahoo! Answers