r/HTML • • Nov 01 '13

[HTML] Trying to help a friend update content on his page and clean up his code; new to coding need help repositioning elements

A friend has a simple page site, and the old person who was helping him with it has left. I told him I could maybe help him, but I am stuck. I am quite new at coding and thought this could provide a good learning experience for me.

I am trying to reposition the content for the items, next to the images instead of underneath the images. I then want the two items stacked on top of each other, so that when we want to add more items, we can just stack them on top, and the older items will go down the page.

First post in this sub, so my apologies if my formatting is wrong.

Thanks in advance!

<html>

<head>
<meta name="description" content="This is who we are and what we do">
<title>Thing About</title>
<style type="text/css">img.border {border: 1px solid Red;}</style>
</head>

<body bgcolor=Gainsboro>
<center>
<table cellspacing=0 cellpadding=0 border=0 width=1002 height=801 bgcolor=Black>
<tr><td valign=top align=center>

<table cellspacing=0 cellpadding=0 border=0 width=1000 height=800 bgcolor=A9F5AB>

<tr>
<td valign=top align=center colspan=2>
<img src="BANNER.jpg" border=0 width=1000 height=150></a>
</td>
</tr>

<tr>

<td valign=top align=center>
<table cellspacing=0 cellpadding=5 border=0 width=450>
</tr>
<td>
<br>
<a href="item1.jpg" target="_blank">
<img src="item1.jpg" width=225 class="border" border=0></a>
<a href="item1b.jpg" target="_blank">
<img src="item1b.jpg" width=225 class="border" border=0></a><br>
ITEM 1 TITLE - SUBTITLE<br>
Content goes here idjoadi jfaopijd <br>
<br>
Line of content kherkehlwkjerlwkej<br>
<br>
Line of content lsfdknl fsdlkfslk flskdjfslkdj slkdjf<br>
<br>
<a href="http://www.youtube.com/watch?v=xxxxxxxxxxx" target="_blank">
http://www.youtube.com/watch?v=xTYuh1N8ZaM</a><br>
<br>
</td>
</tr>
</table>
</td>

<td valign=top align=center>
<table cellspacing=0 cellpadding=5 border=0 width=450>
</tr>
<td>
<br>
<a href="item2.jpg" target="_blank"><img src="item2.jpg" width=225 class="border"></a><br>
ITEM 2 TITLE - SUBTITLE<br>
Content goes here idjoadi jfaopijd <br>
<br>
Line of content dsfiah fiudahfijdoa iddfafhaidf<br>
<br>
</td>
</tr>
</table>
</td>

</tr>

<tr>
<td valign=top align=center colspan=2>
<p style="font-family:verdana;font-size:80%;color:black">
STORE CONTACT INFO ASODIFNASLKFA DLAKJFALKJDF ALFDSKJASLKJF ALKDJFALAKSDJ FSLKDJFALSKJ<br>
STUFF AND THINGS
</p>
</td>
</tr>

</table>

</td></tr></table>
</center>
</body>
</html>
2 Upvotes

13 comments sorted by

2

u/ReignofReddit Nov 01 '13

Learn how to do CSS layouts and start from scratch. You won't learn much from trying to modernize a table based layout that's formatted with <br /> tags and inline styles.

1

u/downbytheocean Nov 04 '13

Alright, so I been learnin'. I am starting from scratch, but I am also concurently trying to fix with hacks this one so it can have an immediate affect on its readers.

Disregarding formatting and design, would a solution for a temporary, immediate, layout fix be as simple as replacing each of those table "elements" in a div id?

3

u/soupified Nov 07 '13

Hey OP - I know I'm a little late to the party, but this fiddle should get you started.

I made a lot of assumptions, but hopefully you can use it as a starting point. Try out the HTML and CSS lessons on teamtreehouse.com.

-1

u/icantthinkofone Nov 01 '13

This type of markup was deprecated in 1999 so it's gonna be a struggle.

0

u/[deleted] Nov 01 '13

[deleted]

1

u/downbytheocean Nov 04 '13

Thanks. Yikes, this code is not so good I guess huh?

I know for one thing I should to change from the table based layout-to a div based layout. Is that as simple as enclosing each one of these table "elements" in a div id (..container, is that the correct term)?

0

u/[deleted] Nov 01 '13

[deleted]

-1

u/icantthinkofone Nov 01 '13

How do you know he's serving XHTML? (He probably isn't.) So your change to his html tag makes it incorrect for HTML. Adding the closing slash to the meta tag is also invalid in HTML.

0

u/[deleted] Nov 01 '13

[deleted]

-2

u/icantthinkofone Nov 02 '13

There's nothing wrong with what he has.

1

u/roomzinchina Nov 02 '13

Are you just replying to every post on /r/HTML with utter bullshit? Out of interest, how and where did you 'learn' HTML?

-2

u/icantthinkofone Nov 02 '13

Obviously you are unable to state your complaint but, speaking of utter bullshit, that could be the only thing you could say.

2

u/roomzinchina Nov 02 '13

So you're saying this here:

There's nothing wrong with what he has.

Yet at the bottom you've said this:

This type of markup was deprecated in 1999 so it's gonna be a struggle.

Come on, this is a subreddit for advice, and that is a pretty unhelpful comment. Let's be fair, there is quite a lot wrong with his code so far, 20 Errors, 4 warnings as far as the W3 validator tool goes.

http://validator.w3.org/#validate_by_input

-3

u/icantthinkofone Nov 02 '13

You are pointing at the html tag and saying there's something wrong with it without giving reason. You may be trying to say it needs to declare an XHTML namespace yet you also admit that may not be correct (and you aren't). Whether there are other things wrong with the rest of his markup has nothing to do with what I said and that was that there is nothing wrong with using the html tag as he has it.

I'd bet you aren't aware that the html element is optional, right?

2

u/roomzinchina Nov 02 '13

I honestly have absolutely no idea what your point is, and I am totally done talking to you.

→ More replies (0)