<p> styles in tables

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Charlie
Propeller Head
Posts: 22
Joined: Thu Oct 16, 2008 3:08 pm

<p> styles in tables

Post by Charlie »

When a table is inserted, the default cell style is <td> or <th>. If you press Enter in a cell, it changes to <p>. Slightly annoying :roll: because, if the td or th is different than p (it is in my case) you have to go through the entire table, press enter, then backspace to make all the cells the same. If you don't want the standard <p> in the table cells, you have to go back and individually change each cell to the p tag you want. You can go into the code and do search & replaces, but that's a pain too, especially if there are other tables in the topic.

So, the question... is there a way to specify a p tag in the cells for new tables, or an easy way to change all the cells in a table to a p-type tag?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: <p> styles in tables

Post by LTinker68 »

There is a particular type of complex selector that you can (manually) add to the stylesheet file that will specify that a paragraph tag of a specific class should always follow a td tag. I can't remember the code. I think Dave Lee was the one who mentioned it previously, so maybe he can chime in with the code. Note that it'll do that for all tables unless you create a table class and only set it to happen when the td tag is inside a table set to that particular class.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: <p> styles in tables

Post by NorthEast »

Nope, I think you made that one up!

A complex selector, or anything in your stylesheet, is just applying styles to the tags in your HTML. Nothing in a stylesheet is going to actually add content to your HTML.

What you can do is to use a complex selector to set the properties of a paragraph (p) tag when it's used inside a table cell (td). For example, say your paragraph style had a top margin of 8px, but your table cell style has no top margin. When you use a paragraph tag in a table you might not want to have that top margin, as it will mean text is not aligned with other cells in the table without a paragraph tag.

In this example, you could use a complex selector to set the top margin to zero:

Code: Select all

td p
{
 margin-top: 0px;
}
Charlie
Propeller Head
Posts: 22
Joined: Thu Oct 16, 2008 3:08 pm

Re: <p> styles in tables

Post by Charlie »

That is exactly what I wanted!! Thanks.

The only problem I encountered is that when I made the changes in the table stylesheet .css, then opened the css in the Flare tablestyle editor, made some changes... it wiped out all the manual changes I made. So, now I have a backup in case I forget!

thanks again!
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: <p> styles in tables

Post by LTinker68 »

Dave Lee wrote:Nope, I think you made that one up!
No, I didn't, and it was you! I wasn't referring to the complex selector that you gave Charlie that was apparently what he was looking for. I thought he wanted to set it up so that a <p> was always inserted into a <td> (without having to press Enter) and the code you gave that could do that is in this post --> http://forums.madcapsoftware.com/viewto ... 818#p44018
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Charlie
Propeller Head
Posts: 22
Joined: Thu Oct 16, 2008 3:08 pm

Re: <p> styles in tables

Post by Charlie »

Actually, I asked for the p paragraph to be inserted because I didn't know you could modify the p in the tablestyle sheet. Either way, I'm a happy camper - thanks to both of you! (Except for not really being able to use the Flare editor without loosing all the manual edits.)

Charlie
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: <p> styles in tables

Post by NorthEast »

LTinker68 wrote:
Dave Lee wrote:Nope, I think you made that one up!
No, I didn't, and it was you! I wasn't referring to the complex selector that you gave Charlie that was apparently what he was looking for. I thought he wanted to set it up so that a <p> was always inserted into a <td> (without having to press Enter) and the code you gave that could do that is in this post --> http://forums.madcapsoftware.com/viewto ... 818#p44018
Yep, that's my post, but that isn't talking about a complex selector, and it also doesn't really answer this question. I'll let you off as it's Friday though!
Post Reply