First, make sure that you have set up Expression Web using Tina Clarke's FREE EBook Setting Up Expression Web 3.0 or 4.0
Step 1: In Design view, place the insertion point where you want to insert the table. Do the following:
The following code was added to the head section of my page:
<style type="text/css"> .style1 { width: 100%; border-collapse: collapse; border: 1px solid #999999; } </style>
Step 2: On the Manage Styles task panel, > Right Click the
just created style1. > Choose rename class "style1."
In the Rename Class Dialog Box, Type "tombstones" or whatever you want to name the class. Make sure Rename class references in this page is ticked.
You will see that the class has been renamed "tombstones," and the code for your table changed to:
<table class="tombstones">
Step 3: From the Manage or Apply Styles task panel, > Click New Style.
In the New Style dialog box, type or select the following:
Click thumbnail for larger image
Selector: Type .tombstone td
Define In: Current Page
Block: vertical-align: top
Border: sold ipx #999999
Box: padding 5px (untick: Same for all if you do NOT want the same
amount of padding in the cells.
You will see the style being created in the display area.
Click OK, and the styles will be applied to the table cells.
Step 4: If you want the top row to be a header row, > select the first row of data cells. > Right click > Cell Properties > Tick: header cell. > Click OK.
You can create a new style for the header row by using the same method as described above, OR copy and paste the style you created for:
.tombstones td { vertical-align: top; border: 1px solid #999999; padding: 5px; }
changing the td to th. The default style will be centered and bold
.tombstones th { vertical-align: top; border: 1px solid #999999; padding: 5px; }
If you have a data table already created, you can easily add styling to it.
Step 1: Open the page with the table you wish to style in Expression Web.
From the Quick Tag Selector, > Click <table>.
From the Manage or Apply Styles task panel, > Click New Style.
In the New Style dialog box, type or select the following:
Selector: Type .prisoners
Define in: Current Page
Border: solid 1px #999999
Box: Uncheck: Margins Same for All Top: 10px Bottom: 10 px
(this will add some spacing between the top and bottom of your table from other
text.
Position: width: 100%
Make sure you have ticked Apply Style to document selection
The following code will be added to the head section of your page
<style type="text/css"> .prisoners { border: 1px solid #999999; width: 100%; border-collapse: collapse; margin-top: 10px; margin-bottom: 10px; } </style>
Step 3: From the Manage or Apply Styles task panel, > Click New Style.
In the New Style dialog box, type or select the following:
Selector: Type .prisoners td
Define In: Current Page
Block: vertical-align: top
Border: sold ipx #999999
Box: padding 5px (untick: Same for all if you do NOT want the same
amount of padding in the cells.
You will see the style being created in the display area.
Click OK, and the styles will be applied to the table cells.
Step 4: If you want the top row to be a header row > select the first row of data cells, > right click > Cell Properties > Tick: header cell > Click OK.
You can create a new style for the header row by using the same method as described above OR copy and paste the style you created for:
.prisoners td { vertical-align: top; border: 1px solid #999999; padding: 5px; }
changing the td to th. The default style will be centered and bold
.prisoners th { vertical-align: top; border: 1px solid #999999; padding: 5px; }
Example: Fully Styled Data Table
Sample Styled Accessible Table Using External Style Sheet
Copyright © January 2010 Pat Geary of
Expression Web Tutorials and Templates, All Rights Reserved
Expression Web 4.0 Tutorials 2nd Edition from Install to Publish, a FREE EBook by Pat Geary.
Expression Web has a group on Facebook. If you are a FB user, come join us.
Disclosure: This is an affiliate link, which means that if you visit Bluehost.com through this link and purchase this product, I’ll get a commission.
April 2007 - April 2013
Privacy Policy | Migrating from FrontPage to Expression Web
Microsoft® and Expression Web® are registered trademarks of Microsoft® Corporation.
Site Design & Maintenance : Expression Web Tutorials & Templates