Tables in posts
This may be obvious to some but ‘beat me over the headwith a wet fish’, I can’t work it out.
Coming from a html background I was able to insert columns and rows of lists/text etc relatively easily into a page.
After visiting this forum for some time now, I am left with the distinct impression that tables are no longer an acceptable method. That’s fine and you won’t catch me arguing with you, but how do you go about making say 2-3 -4 lists which spread across a post and don’t just make one long list?
You can use tables. There’s an ‘anti-table’ crowd around that thinks they shouldn’t be used for major page layout, but I can’t imagine actual tabular data being confused with page organization… In fact, this came up with the Calendar (which I did a CSS-only, non-table version of just to learn CSS!). And it remains a table.
I’ve put tables into posts a bunch of times, as I repost press releases that have them embedded, and easier than trying to figure out how to reformat.
So if I use
<table> <tr><td>and so on it will work in posts ?
What do you those who oppose it use though?Anonymous
Tables are good if you’re actually using it to display tabular data, but they aren’t for layouts.
Now I am really confused. I can see that css is the best way to go but all I am really after is a simple method of inserting a borderless/same colour background as page/ 2 0r 3 column table structure which I can use easily in my posts.
For example, instead of a long list of 30 pieces of text, how can I make it so that I have 2 x 15 or 3 x 10 ?
Does anyone have an example of a simple piece of their css and how they actually use it when posting?
I do not to dampen your enthusiasm in any way but as I understand your question this is going to require php hacking.
Shadow, for your uses, I think a table, like the ones you are probably used to, is going to be your best bet. Don’t let all the options and php hacking intimidate you, just use regular table markup in your posts for your tabular information.
The anti-table crowd isn’t anti-tables in every circumstance, only anti-tables for layout.
The table tags weren’t meant to layout the design of your site, they were meant to display tabular data, like a price list or something. If that is what you are doing, then a table will work best. You can style the table using CSS if you want to remove the border, change the background color, etc. But don’t worry about laying out your tabular data using <div> tags and CSS, that would be overly complicated, and would not be semantically meaningful. If you are structuring the data in a table because it needs to be in a grid to make any sense (again, like a price list, or a table of names and ID numbers or something), then a table is the correct markup. If you are laying it out in a grid because it is asthetically pleasing to you, then you should probably be using CSS to lay it out.
Are you looking for a way to do text flowing into multiple columns? Something like how IHT lays out their articles?
Thanks for all your input/replies.
Maybe the best thing to do is to show you an example. At http://www.os42.com/index.php?cat=2 I have a post which contains a long list of links. I couldn’t work out how to display them in the post in a neat table with say two columns, thus shortening the length of the post, so I used the [more] function to make it at least partially presentable.
Ideally, I would like to be able to put such lists in a post in a nicer format. From what I can understand here, to make a table in the post I can use the
<table> <tr> <td>tags but this is going to be a time consuming task so I guess I will have to work out the css option.
So, I went to the sites suggested by junesix but couldn’t find reference to a simple example that I need. This http://www.bowdoin.edu/templates/tables.html shows me something about table structure in my css but I can’t wrap my head around how to do it. I would imagine the css goes in my layout css file but where/ how do I do the table bit with the classes?
And, even if I work out that bit, how do I then use it in admin when making a post?
Unfortunately, nobody in HTML/CSS land seems to have come from the page-layout world, where multi-column flows are just ‘standard’. I think it’s horrible that such features are missing (specify a div/block, and specify how many columns to flow within its width).
Doing it by-hand really isn’t that bad. You can make a table with three columns, one row, and just manually break between the columns. It’d be nice to have some sort of ‘auto generator’, where you pass it some kind of array or comma delimited list, and it’d turn it into a multi-column layout. For now, keep it simple, and do it by hand.
Ignore all the comments about trying to use CSS to do this. This is a job for tables. 😉
I have tried using something like this as a test and it all looks ok in terms of layout… but it seems to be a hell of a lot of work for something so simple.
The font in the table is too large as well, so I gather I have to also put in font tags to sort all this out?
I am beginning to think I won’t be posting too many lists from here on in – whaaaaaaaaaa
Is the following an acceptable method do you think ?
<table align="center" width="60%" border="0" cellpadding="0" cellspacing="0">
<td width="50%" align="left">left text here row 1</td>
<td width="50%" align="left">right text here row 1</td>
<td width="50%" align="left">left text here row 2</td>
<td width="50%" align="left">right text here row 2</td>
Life is one big learning curve 🙂
I am not sure we have really got our heads around this yet. Regardless of tables / css the problem is to get WP to split a list into two places, presumably according to its length. The problem as stated in layout terms is surely relatively simple?
I’m currently designing one of my sites (my first WordPress site).
I’m designing it with tables… mmmmmm tables! Sorry, but I like tables.
Anyways, if you’re going that approach, the best way it to work backwords 🙂
What I do and have always done (not just because it’s easier, but because the page ends up being more beautifully designed), is design the page how you want it to look (without the WP coding – keep it in mind though). Then, just add in the WP coding, or for a guideline, copy and paste bits and pieces of the code from the default WP template 🙂
– you don’t need to set the table width necessarily, if you want it to stick to the width of the post…
– you don’t want to do EACH link individually, just one row, two columns –I hinted at that, but should have been clearer.
<table align="center" border="0" cellpadding="0" cellspacing="0">
<td width="50%" align="left">links here with LFs or
after each one</td>
<td width="50%" align="left">second column of links here....</td>
- The topic ‘Tables in posts’ is closed to new replies.