With the current setup of my site I have the following <div><table><tr><td><a href></td><a href><a href></td></tr></table></div> Would it be ok to do <div><a href><table></table></a></div> I basically want to elimination repeating my <a href=""></a> 3 times because everything inside the DIV links to the same place, except each piece of content is different, so i link an image, text, and a buy now button I want to avoid the onClick on the div because of the possibility of javascript being disabled.
What other method would you recommend to get what I want done? I have no choice but to put an onClick on the div?
As suggested above a table is a block element, so you have to ask yourself is the table nessecary. For example could you put the information inside a SPAN element, which is an inline element and you could then wrap your anchors (a) around the SPAN. <div><a><span></span></a></div> It depends on what goes inside the anchor as you could possibly even get away without using a SPAN at all. So if you need help further post up some example code.
What is your data? The obvious answer is probably don't use a table... Without seeing what you are plugging in for data, it's hard to say your best approach, though I suggest you learn what elements are 'inline-level' and 'block-level' (which is NOT the same thing as the css display properties)
If there is only one line in your table it is probably best you don't use one at all. Try an unordered list <ul>. <div><table><tr><td><a href></td><a href><a href></td></tr></table></div> - This is defiantly invalid.
I basically have. DIV Table then 2 TDs (left one an image: right side text) close table close div I'm currently just using the onClick event on the DIV
So what exactly is the use of the table, doesn't seem like it has one. What is wrong with: <div class="myDiv"> <a href="mylink/htm"> <img src="myimg.jpg" /> <span>My Text</span> </a> </div> Code (markup): You can style the P and IMG to look and appear wherever you want, and they will both be a linked to the same page. It's best to only use tables for tabular data.
Huh, thread necro of a year old post, NEITHER post of which seems to have ANYTHING to do with what was being discussed... (the first of which is completely invalid order) Just trying to get your post counts up so you can start spamming the services section or something, or is this just a total /FAIL/ rooted in engrish moist goodry?