PDA

Click to See Complete Forum and Search --> : Help! (it's real easy)


kiwis
May 7th, 2004, 07:43 PM
Can somone maybe using front page make a table with one row and one cell wide.
I want a picture to be in it and the whole background to highlight when you hover your mouse over it!! real easy if you use DHTML on front page... I don't have this any more.. can someone please help

davebat
May 10th, 2004, 02:40 AM
Here you go


<TABLE width="200" border="1" cellspacing="0" cellpadding="0">
<TR>
<TD style="width:100%; background-color:lightblue"
onMouseover="this.style.backgroundColor='yellow';"
onMouseout="this.style.backgroundColor='lightblue';">
<i>Insert Picture here</i>
</TD>
</TR>
</TABLE>

Acidic
May 10th, 2004, 05:19 AM
why have a table with only one cell? Why not use a <div> instead?

mendhak
May 10th, 2004, 06:24 AM
Originally posted by Acidic
why have a table with only one cell? Why not use a <div> instead?


More control for later changes.

And <DIV>s are slightly evil. Although not as evil as <SPAN>s.

Acidic
May 10th, 2004, 06:45 AM
I thinks <div>'s are not evil. <table>'s are pointless, as CB pointed out is an earlier thread. At least unless you actually want to tablulate data, eg results from a survey or something.

I use <span>'s as one line <div>'s. For when I need to alter text in JS.

mendhak
May 10th, 2004, 06:52 AM
<SPAN> and <DIV> are basically meaningless. Should be avoided if there is a better way to do the same thing.

If no other way, then hey, whatever floats your boat.

CornedBee
May 10th, 2004, 07:04 AM
Spans and divs are what the name says: spans and divisions. They have meaning, if not much. Divs represent sections of your page (XHTML 2 will have a <section> tag to make this clearer). They divide your page into logical parts, like navigation and content, the content into subheadings, the subheadings into blocks. The div is indeed the most useful tag in HTML in a way.

Tables are what the name says too. But, unlike spans and divs, they have lots of meaning. They mean data, organized by rows and columns. They don't mean layout. If they did, they'd be called grids, not tables.

Tables don't give you more control for later changes either. In fact, they take away control. Using divs, you can just change the CSS that affects them. Using tables, you have to change the table, i.e. the HTML code.


Tables for layout are evil. Tables for tabular data are not.
Divs just for layout are slightly evil, though sometimes there's no choice. Divs for dividing something into sections are perfectly valid and make good sense. I use them all the time for it.
Use Mozilla and go to my homepage:
http://stud3.tuwien.ac.at/~e0226430/base.xhtml
(IE won't load it anyway).
Look at the source code. Notice how lean the source is? Not a single table.
Then go to View->Use Style and try out the various styles, especially Mozilla Heaven and Parchment as opposed to Standard or Yellow/Gray. Completely different look, same code. No way you could ever do that with tables.

And yet, not a single span or div that doesn't make sense.

ober0330
May 10th, 2004, 08:02 AM
congrats... you've just created a website that rules out half the browsing community. While I'm impressed with the style capablities, I can't get past the lack of browser cross-compatibility.

Acidic
May 10th, 2004, 08:10 AM
Actually it rules out more than 1/2. On the other hand, the site is standards compliant, therefore it is the browsers fault if the people can't visit the site.
I do try making my site work in all browsers, but sometimes I just want to forget IE and make it work in all real browsers.
I'm sure I've read a thread like this before, people asking CB why he doesn't make his site work in IE.

/me going to have a look what the site looks like in IE.

Edit: hehe, it tried to download the .xhtml file. That's why I only ever use IE to see what my pages look like in it,

davebat
May 10th, 2004, 08:43 AM
It might be the browsers fault and it might not be a real browser but if if your trying to make money of the web then you have to make sure people can see your site.

It creates a bad impression if your site wont load in IE, whereas if you coded it for IE a few geeks might whinge about it not being standard HTML.

mendhak
May 10th, 2004, 10:13 AM
CornedBee:

Some of the webapps we make here contain complex nested forms. I'd definitely like to see how this can be done using just <DIV>s and <SPAN>s without hassle.

Of course, given time, anything can be done with those tags, I agree, but when time is of the essence, the tables come in real handy.

Then, when requirements change, and you're asked to change the layout of the forms or objects on the page, nothing works better than tables.

Oh, and when I mentioned "meaningless", I wasn't going by the literal definition. :p

mendhak
May 10th, 2004, 10:15 AM
Originally posted by davebat
It might be the browsers fault and it might not be a real browser but if if your trying to make money of the web then you have to make sure people can see your site.

It creates a bad impression if your site wont load in IE, whereas if you coded it for IE a few geeks might whinge about it not being standard HTML.

I'll agree with this. Most webapps I've seen have been created solely for IE, despite it's non-compliance.

CornedBee
May 10th, 2004, 10:46 AM
davebat: My page is not about money. It's about making a point. As such, I really enjoy that fact that IE doesn't display it and I don't plan on changing it.

whereas if you coded it for IE a few geeks might whinge about it not being standard HTML.
I happen to be one of those geeks :)

mendhak: I am writing a form-heavy web-app, using only standard HTML 4.01 Strict as it was intended (i.e. no layout tables) and it works perfectly. Can't show it in public though. I'll see if I can extract some of the code.

Then, when requirements change, and you're asked to change the layout of the forms or objects on the page, nothing works better than tables.
On the contrary, this is exactly when you're doomed with tables.

mendhak
May 10th, 2004, 11:24 AM
Originally posted by CornedBee

On the contrary, this is exactly when you're doomed with tables.

Not very agile, are we now? :D

CornedBee
May 10th, 2004, 12:39 PM
Huh?

davebat
May 11th, 2004, 02:35 AM
Originally posted by CornedBee
davebat: My page is not about money. It's about making a point. As such, I really enjoy that fact that IE doesn't display it and I don't plan on changing it.


Isnt the heart of the internet about sharing information?

CornedBee
May 11th, 2004, 03:20 AM
Tell that Amazon and E-Bay. A lot of "sharing information" there :)

mendhak
May 11th, 2004, 03:07 PM
:lol:

vbNeo
Jun 3rd, 2004, 09:23 AM
Originally posted by davebat
Isnt the heart of the internet about sharing information?

Not according to Microsoft since their browser doesn't support the standards :p

davebat
Jun 3rd, 2004, 09:29 AM
Originally posted by vbNeo
Not according to Microsoft since their browser doesn't support the standards :p

Microsoft didn'tinvent the internet so that doesn't really have any relevance.

vbNeo
Jun 3rd, 2004, 09:34 AM
Originally posted by davebat
Microsoft didn'tinvent the internet so that doesn't really have any relevance.

No, but what they did invent is the worlds most used and most crappy browser that ships with the worlds most crappy operating system. If they had done their job probably, MoZilla wouldn't even have a cause.

Damn spelling mistakes

davebat
Jun 3rd, 2004, 09:42 AM
Originally posted by vbNeo
No, but what they did invent is the worlds most used and most crappy browser that ships with the worlds most crappy operating system. If they had done their job probably, MoZilla wouldn't even have a cause.


They did their job properly by creating the worlds most used browser. As a company they exist to make money and they are very good at that.

vbNeo
Jun 3rd, 2004, 10:15 AM
Originally posted by davebat
They did their job properly by creating the worlds most used browser. As a company they exist to make money and they are very good at that.

They did a good job as materialistic bastards, but they, as usual, spit on the user.