[Pro] XHTML Strict and Tables?

What’s up with XHTML Strict encoding and tables?

Tonight, I tried to switch an HTML 4.01 Traditional web page over to XHTML Strict and many of my cell height specs got totally screwed up, especially 1 px cells I was using to create rules. I finally gave up and changed the page back to HTML 4.01 Traditional.

I take it XHTML handle tables differently than HTML, but I’m not sure how to fix the height problems I was having.

http://www.williamsburgmemorialpark.com/properties/propertyoptions.html


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well this really sucks.

http://csslara.com/post/2008/11/11/xhtml-cellspacing-and-xhtml-padding-for-xhtml-tables-1

So how do I make tables work with FWP using XHTML coding?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m not sure it’s as bad as all that… If I understand the issue (and I may
not, fair warning) the code shown the article is not at all like the code
in your own example. For instance,

Article code: <table cellspacing="0" cellpadding="0" border="0">

Your example code: <td style="width:86px; height:54px;

background:#4976a6; padding:1px; vertical-align:middle">

I’m not sure exactly why FWP changes your cell measurements, but you should
be able to rework the table back into shape. And this time, instead of
empty table cells for rules, you could actually just selectively stroke the
table objects (cells) to achieve this effect. FWP is already using inline
css styles to decorate your table, so all should be good once you undo the
shifting.


Ernie Simpson

On Thu, Sep 27, 2012 at 10:39 AM, RavenManiac email@hiddenwrote:

Well this really sucks.

http://csslara.com/post/2008/11/11/xhtml-cellspacing-and-xhtml-padding-for-xhtml-tables-1

So how do I make tables work with FWP using XHTML coding?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ernie, thanks for your help. That’s the problem I’m having. No matter what I do I can’t get the table cell height to cooperate. Here are a few examples:

HTML 4.01 Transitional
http://www.williamsburgmemorialpark.com/properties/propertyoptions.html

XHTML 1.0 Strict
http://www.williamsburgmemorialpark.com/properties/test.html

The only thing I changed was the encoding. Any thoughts on what may be causing this?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Does anyone know why this is happening or how I can fix it?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Your table has padding set for the table itself at 1px all around. The table cells (td) inherit this property. Padding is added to the outside of height, and you get a 3px border by using a color-filled cell as a rule between rows. Try adding a border-bottom attribute to the td, and skip the extra row that you are currently using to define your rules, and you will get a nice solid single-pixel line. Further, you will be avoiding a cardinal mistake: mixing content and presentation. The table is a semantic structure – it contains data organized in a tabular layout. When you use a single row of that table not for data, but for a visual style, you confuse this data structure.

http://scripty.walterdavisstudio.com/table-borders

A very minimal example showing a single pixel border between rows.

If you wanted to only have this border on certain rows, you would create a class-based style and apply it only to those cells you wanted to have the border.

Walter

On Sep 29, 2012, at 3:26 PM, RavenManiac wrote:

Does anyone know why this is happening or how I can fix it?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The code says the FWP is building the empty table cells on the Transitional
page with transparent .gif images to force the height. In the Strict page,
those empty cells contain empty paragraph

elements which are setting
those heights.

The best answer is that you should not be using empty table cells/rows for
decoration. You need to re-adjust that table in FWP to achieve the styles
you want using CSS borders and not table rows for rules or spacers.

Adding these two lines of code will achieve the desired appearance.
However, you and I will know the table needs to change.

table#product-matrix p { line-height: normal; }

table#product-matrix p.f-sp { margin: 0; }


Ernie Simpson

On Sat, Sep 29, 2012 at 3:26 PM, RavenManiac email@hidden wrote:

Does anyone know why this is happening or how I can fix it?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks guys. I didn’t know that. I’ll modify the table to eliminate the empty cells. :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, I’m not getting how you’re adding the border. Are you using the Extended Attributes for td within the FWP inspector? If so, what code are you adding?

**Please note that I’m using the Table Styler Action on that table, so I’m not sure if that action overrides the extended code.

Also, I couldn’t find how I can add a border in CSS. Are you suggesting I use the Extended Attributes there as well?

Thanks.

On 29 Sep 2012, 8:00 pm, waltd wrote:

Your table has padding set for the table itself at 1px all around. The table cells (td) inherit this property. Padding is added to the outside of height, and you get a 3px border by using a color-filled cell as a rule between rows. Try adding a border-bottom attribute to the td, and skip the extra row that you are currently using to define your rules, and you will get a nice solid single-pixel line. Further, you will be avoiding a cardinal mistake: mixing content and presentation. The table is a semantic structure – it contains data organized in a tabular layout. When you use a single row of that table not for data, but for a visual style, you confuse this data structure.

Table Borders

A very minimal example showing a single pixel border between rows.

If you wanted to only have this border on certain rows, you would create a class-based style and apply it only to those cells you wanted to have the border.

Walter

On Sep 29, 2012, at 3:26 PM, RavenManiac wrote:

Does anyone know why this is happening or how I can fix it?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You have to add the code by hand to the head of the page. Take the following and paste it into your Page / HTML Markup / Before dialog:

<style type="text/css">
	#myTable td {
		border-bottom: 1px solid #ccc;
	}
</style>

Be sure when you do to change the myTable reference to the name of the HTML box holding your table (I’m assuming here that the table is itself a layer element on a CSS-positioned page – all Freeway Pro defaults). If you are using a table-positioned layout, you’ll need to use my AddSelector Action to add an ID attribute to the table itself, otherwise you’ll have to make the style rule less specific and it will apply to every table cell on the entire page.

My example page was hand-coded, just to show what you can do with a table. No, Freeway doesn’t make this sort of detail easy. Yes, it makes it trivial to add borders around the entire table and all of the cells. Ironically, you can easily add these sorts of borders to DIV (HTML box) elements, using the Custom part of the Border tool.

If you want to add a quick underline to one cell of a table (not all of the cells) you could use the Inspector. Choose the cell with a single-click, and look in the first tab of the Inspector. You’ll see options for the row, column, and current cell. Clicking Extend in any of these, you can add a border by entering the following (after pressing New in the dialog):

  • Name: style
  • Value: border-bottom: 1px solid #ccc

You could substitute border-right or -left or -top if you like, and the colors can be anything you need for your design, naturally. There are about 7 different styles for a border, but most of them require a width greater than 1px for them to look like anything useful.

Walter

On Sep 30, 2012, at 5:58 AM, RavenManiac wrote:

Walter, I’m not getting how you’re adding the border. Are you using the Extended Attributes for td within the FWP inspector? If so, what code are you adding?

**Please note that I’m using the Table Styler Action on that table, so I’m not sure if that action overrides the extended code.

Also, I couldn’t find how I can add a border in CSS. Are you suggesting I use the Extended Attributes there as well?

Thanks.

On 29 Sep 2012, 8:00 pm, waltd wrote:

Your table has padding set for the table itself at 1px all around. The table cells (td) inherit this property. Padding is added to the outside of height, and you get a 3px border by using a color-filled cell as a rule between rows. Try adding a border-bottom attribute to the td, and skip the extra row that you are currently using to define your rules, and you will get a nice solid single-pixel line. Further, you will be avoiding a cardinal mistake: mixing content and presentation. The table is a semantic structure – it contains data organized in a tabular layout. When you use a single row of that table not for data, but for a visual style, you confuse this data structure.

Table Borders

A very minimal example showing a single pixel border between rows.

If you wanted to only have this border on certain rows, you would create a class-based style and apply it only to those cells you wanted to have the border.

Walter

On Sep 29, 2012, at 3:26 PM, RavenManiac wrote:

Does anyone know why this is happening or how I can fix it?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That worked great. Thanks Walter. But, how do I handle spacing between rows?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You use padding in the td. You can set this in a limited way when you create the table, or using the table Inspector. If you want to make it asymmetrical, you can use the HTML Markup to add that to your style block. If you set the padding of all TDs in your table to 4px 8px (4px top and bottom, 8px left and right) you’ll get a nice spacing that reads well.

Walter

On Sep 30, 2012, at 2:16 PM, RavenManiac wrote:

That worked great. Thanks Walter. But, how do I handle spacing between rows?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I want to add 20 pixels of space between certain rows to break sections up. I tried inserting the following code into the cell and it didn’t work:

Name: style

Value: padding-bottom: 20px


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try making a new style rule:

tr.extra td { padding-bottom: 20px }

Then select your cell, in the left-most tab of the inspector look in the Current Row segment and click on the Extend button there. Use the New button to add this:

  • Name: class
  • Value: extra

The issue you’re probably seeing is that the same style you added to one cell would have to be added to each cell in the row in order to push the entire next row down. This style rule makes such a sweeping change automatically, through the CSS Cascade. All TDs that are the child of the TR with the classname ‘extra’ get the same style – a 20px bottom padding. This forces the next row down all across the row.

Walter

On Sep 30, 2012, at 2:42 PM, RavenManiac wrote:

I want to add 20 pixels of space between certain rows to break sections up. I tried inserting the following code into the cell and it didn’t work:

Name: style

Value: padding-bottom: 20px


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I hate to sound totally stupid, but can you walk me through creating a new style and adding the padding code?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In the block you already have in this page, paste the new code as a second line, so you end up with this:

<style type="text/css">
	#myTable td {
		border-bottom: 1px solid #ccc;
	}
	tr.extra td { padding-bottom: 20px }
</style>

Walter

On Sep 30, 2012, at 3:18 PM, RavenManiac wrote:

I hate to sound totally stupid, but can you walk me through creating a new style and adding the padding code?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And now that I think about it a little more, you’ll probably need this to force the issue:

<style type="text/css">
	#myTable td {
		border-bottom: 1px solid #ccc;
	}
	#myTable tr.extra td { padding-bottom: 20px }
</style>

The ID-based styles are “worth” more in the cascade, so you have to use a similar or greater degree of specificity (thanks, Todd) to override one.

Walter

On Sep 30, 2012, at 3:36 PM, Walter Lee Davis wrote:

In the block you already have in this page, paste the new code as a second line, so you end up with this:

#myTable td { border-bottom: 1px solid #ccc; } tr.extra td { padding-bottom: 20px }

Walter

On Sep 30, 2012, at 3:18 PM, RavenManiac wrote:

I hate to sound totally stupid, but can you walk me through creating a new style and adding the padding code?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The style you’re referring to above is something David helped me setup so I can get drop shadows on my drop down menus. I’ll paste it here f you tell me how to quote code in the green box.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

A lot of discussion on this one, sorry to have not joined in sooner.

http://cssway.thebigerns.com/workbench/rm_data_table/


Ernie Simpson


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ll paste it here f you tell me how to quote code in the green box.

To get the ‘green code box’ in the web view type 4 tildes (~) start a new line, paste your code, start another new line and type 4 more tildes(~)

some code in here

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options