Word XHTML - Tables
This is the fifth post by Zeyad Rajabi who owns the XHTML output from Word's new blogging feature. In earlier posts, Zeyad discussed a general overview of the XHTML, details on XHML compliance, how we map styles to semantics, and bullets and numbering. Today Zeyad is discussing the ways in which output tables.
Today I will be talking about tables in our blogging feature. Similarly to other supported Word features, our XHTML output for tables is not full fidelity. Word 2007 provides you with a rich editing experience that allows you to create a multitude of different types of tables. Our blogging feature only supports a handful of the possible types of tables that can be created in Word 2007.
Below is a table that enumerates all the table related HTML elements and the possible attributes and CSS properties that can be output for those elements.
HTML Elements | HTML Attributes | CSS Properties |
table | borderstyle | border-collapsebackground |
colgroup | - | - |
col | style | width |
tbody | valign | - |
tr | style | background height |
td | colspan rowspanstyle valign | background border-bottom border-left border-right border-top padding-bottom padding-leftpadding-rightpadding-top |
I think the easiest introduction to our XHTML output for tables is to show some sample examples.
Example 1:
This example is the default table style for Word.
One | Two |
Three | Four |
Our XHTML output for the table can be found here.
Example 2:
This example shows shading applied to cells vs. rows.
February | ||||||
M | T | W | T | F | S | S |
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Our XHTML output for the table can be found here.
Example 3:
This example shows difference of fidelity when publishing from Word:
In Word | In Browser |
Our XHTML output for the table can be found here.
Example 4:
This example shows different borders being applied to different cells:
August 2006 | ||||||||||||
Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat | ||||||
1 |
2 | |||||||||||
3 |
4 |
5 |
6 |
7 |
8 |
9 | ||||||
10 |
11 |
12 |
13 |
14 |
15 |
16 | ||||||
17 |
18 |
19 |
20 |
21 |
22 |
23 | ||||||
24 |
25 |
26 |
27 |
28 |
29 |
30 | ||||||
31 |
Our XHTML output for the table can be found here.
Comments are welcome
Comments
Anonymous
August 14, 2006
How does the blogging feature in MS Office 2007 compare to the new Windows Live Writer beta that has just been released also by Microsoft ?
Wouldn't it have been simpeler to add the Windows live writer to Office 2007 as a separate usefull tool ?Anonymous
August 15, 2006
I hope you're gonna be trimming down the embedded styles in release version - thats a huge amount of redundant code you're putting inline.. not working with intranets anymore ;)Anonymous
August 15, 2006
The comment has been removedAnonymous
September 15, 2006
Welcome to the Microsoft Office Word Team's blog; you source for all things Word related. I'm Jonathan...Anonymous
June 17, 2009
PingBack from http://patiosetsite.info/story.php?id=997Anonymous
June 18, 2009
PingBack from http://adirondackchairshub.info/story.php?id=3790