Home › Forums › JavaScript › i hate loving divs..
- This topic is empty.
-
AuthorPosts
-
September 23, 2011 at 7:44 pm #34479
mikeman
Membertheir great tools but a pain in my butt..
im trying to make a div thingy that looks like this
http://ocixx.com/joseph/wp-content/uploads/2011/09/div.png
i indent on eventually putting two of thos side by side.. i want to use it to display song title – artist and then a Buy button, bting the far right boxes.
could anyone help me out?
September 23, 2011 at 7:58 pm #87845TheDoc
MemberLooks a hell of a lot like a table!
September 23, 2011 at 8:37 pm #87848chrisburton
Participant“div thingy” is my new phrase.
September 24, 2011 at 1:19 pm #87867thomas
MemberTo the people saying to “just use a table,” you may be right, but let’s suppose for a minute that the image @mikeman provided was for the layout of a proposed website. In that case, <div>s or more semantic elements would be more appropriate.
Here’s some quick code for a general idea of how to create that type of layout:
#left-col {
float: left;
width: 300px;
}
#right-col {
margin-left: 300px;
width: 100px;
}
.row {
height: 20px;
border: 1px solid #000;
border-bottom-width: 0;
}
.row:last-child {
border-bottom-width: 1px;
}
#left-col .row {
border-right-width: 0;
}
footer {
clear: both;
width: 398px;
height: 50px;
border: 1px solid #000;
border-top-width: 0;September 24, 2011 at 1:22 pm #87869chrisburton
Participant@thomas, he stated he was going to display artists and song titles, a perfect use for tables.
September 24, 2011 at 1:32 pm #87872thomas
Member@ChristopherBurton, right, and I would probably use a table as well, but without actually seeing the information he is putting into it, it’s really a matter of opinion of whether it would be considered tabular data or not.
I posted the code as an example to others that might find it useful who may not be creating a layout that is best represented by a table.
September 24, 2011 at 1:41 pm #87874thomas
Member@Adman, I didn’t check his website, and I’d like to reiterate that I’m not suggesting that tables aren’t the right approach for this.
The example I gave was to create the layout he requested, not to spark a debate about the semantics of tables.
September 24, 2011 at 1:57 pm #87876chrisburton
Participant@thomas “right, and I would probably use a table as well, but without actually seeing the information he is putting into it, it’s really a matter of opinion of whether it would be considered tabular data or not.“
He did and this is what he wrote in his original post:
“im trying to make a div thingy that looks like this
http://ocixx.com/joseph/wp-content/uploads/2011/09/div.pngi want to use it to display song title – artist and then a Buy button, bting the far right boxes.“
…perfect use for tables
September 24, 2011 at 2:08 pm #87880thomas
Member@ChristopherBurton, it looks like you’re getting hung up on whether this is a good use case for tables, and I’ve already made it very clear that I agree it is.
As for my statement of not seeing the information he will be using in that layout, it still stands. To “display song title – artist and then a Buy button” is not enough information to know what the finished version of that layout will look like. What if he includes a description, images, links to reviews, etc.? Maybe a table would still be the best choice, but you’re starting to enter a gray area. I’m giving him the benefit of the doubt.
At any rate, I consider the original question of how to recreate the layout solved, and now we’re veering off topic.
Final disclaimer: I do not advocate the use of excessive divs to recreate tabular markup. A table is the semantically appropriate element for tabular data.
September 24, 2011 at 3:04 pm #87884chrisburton
ParticipantNo one is fighting? Lol
But it’s quite simple, he would have explained that in the original post in which he didn’t.
Your argument is “what if” and originially made this off topic by marking up the incorrect solution that was already solved. That’s all I really have to say. -
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.