How to create a table with fixed-width columns regardless of contents, and/or the type of browser in use (e.g. IE, NN, Opera)?

Here is an example:

<table border=1 width=183 style=‘table-layout:fixed’>
<col width=67>
<col width=75>
<col width=41>
<tr>
<td>First Column</td>
<td>Second Column</td>
<td>Third Column</td>
</tr>
<tr>
<td>Row 1</td>
<td>Text</td>
<td align=right>1</td>
</tr>
<tr>
<td>Row 2</td>
<td>Abcdefg</td>
<td align=right>123</td>
</tr>
<tr>
<td>Row 3</td>
<td>Abcdefghijklmnop</td>
<td align=right>123456</td>
</tr>
</table>

Notice how a very long entry does not cause a column to expand.

There are three (3) elements involved here to maintain cross-browser consistency.
1) use of width attribute in the table tag
2) use of ‘table-layout:fixed’ property in the style attribute of the table.
3) use of col tags to designate column widths

Make sure the value of the width attribute of the table tag is equal to the total of the width attributes of the col tags.

The 3 elements altogether is redundant if you are using IE. But this approach is needed to take care of the way some browsers like NN behaves differently when specifying column widths.

There are other ways to accomplish this, but this approach is the *easiest* to maintain, especially if you frequently add and delete table rows and/or columns. You don’t have to put style sheet properties on every TD tags.

NOTE:

I used IE6, NN6, Opera7 and Firefox 0.9 to test this. Users of Netscape and Firefox may not like to see table cells with overflowing long texts (because of fixed column-widths), so I updated this FAQ to include the following code in the CSS style definition inside the <HEAD> tags or in the external CSS file:

<style>
td {overflow:hidden;}
</style>

NOTE: This is an archive/copy of the article posted here: http://www.tek-tips.com/faqs.cfm?fid=4499

Firefox Profile Manager and Backup/restore Profiles on Portable Firefox

A. Creating a New Firefox Profile.
1. Close all instances of Firefox:

2. Run the following code:
F:\PortableApps\FireFox3Portable\App\Firefox\firefox.exe -P

NOTE: Make sure the above path suits your install location

4. It is nice to put the profiles into a central location, thus convenient in future.
Ex:
F:\PortableApps\FireFoxProfiles/ff3
F:\PortableApps\FireFoxProfiles/ff4
F:\PortableApps\FireFoxProfiles/ff5

3. You will get profile manager, now create as many profiles as you need
ex: firefox2, firefox3, firefox 4, firefox5 etc…

B. How to Backup Profile Data/Copy Profile data from one profile to a new one?

Profile data contains several things, the bookmarks, passwords, settings addons etc…

1. Just browse to “F:\PortableApps\FireFoxPortable\Data\profile”

2. Copy this to your profile folder ex to “F:\PortableApps\FireFoxProfiles/ff4”

C. Running the browser using a specific profile.
That’s all run your new Firefox Browser usign following Shortcut:
F:\PortableApps\Firefox4Portable\App\Firefox\firefox.exe -p firefox4 -no-remote

Real URL Config for tt_products

There are many posts regarding adding realurl to tt_products but I found that the fillowing code works well.

Copy this code to your realurl configuration file. Disable the realurl autoconf in the Backend.

// product categories
‘categories’ => array (
array (
‘GETvar’ => ‘tt_products[cat]’ ,
‘lookUpTable’ => array (
‘table’ => ‘tt_products_cat’ ,
‘id_field’ => ‘uid’ ,
‘alias_field’ => ‘title’ ,
‘addWhereClause’ => ‘ AND NOT deleted’ ,
‘languageGetVar’ => ‘L’,
‘useUniqueCache’ => 1 ,
‘useUniqueCache_conf’ => array (
‘strtolower’ => 1 ,
‘spaceCharacter’ => ‘-‘ ,
)
)
)
),
// products
‘products’ => array (
array (
‘GETvar’ => ‘tt_products[product]’ ,
‘lookUpTable’ => array (
‘table’ => ‘tt_products’ ,
‘id_field’ => ‘uid’,
‘alias_field’ => ‘title’ ,
‘addWhereClause’ => ‘ AND NOT deleted’ ,
‘languageGetVar’ => ‘L’,
‘useUniqueCache’ => 1 ,
‘useUniqueCache_conf’ => array (
‘strtolower’ => 1 ,
‘spaceCharacter’ => ‘-‘ ,
)
)
)
),
// backPID
‘backPID’ => array (
array (
‘GETvar’ => ‘tt_products[backPID]’ ,
‘lookUpTable’ => array (
‘table’ => ‘pages’ ,
‘id_field’ => ‘uid’ ,
‘alias_field’ => ‘title’ ,
‘addWhereClause’ => ‘ AND NOT deleted’ ,
‘languageGetVar’ => ‘L’,
‘useUniqueCache’ => 1 ,
‘useUniqueCache_conf’ => array (
‘strtolower’ => 1 ,
‘spaceCharacter’ => ‘-‘ ,
)
)
)
) ,

Display News Title as Page Title in tt_news detail view

To Display the news title in the detail view of tt_news instead of page title use the following code

[globalVar = TSFE:id = {$newsSinglePid}]
temp.newsTitle = RECORDS
temp.newsTitle {
source = {GPvar:tx_ttnews|tt_news}
source.insertData = 1
tables = tt_news
conf.tt_news >
conf.tt_news = TEXT
conf.tt_news.field=title
wrap = <title>|</title>
}
page.config.noPageTitle = 2
(Your Object) >
(Your Object) < temp.newsTitle
[global]

Technorati : , ,