Fully customizable actionbar on the Web

Don't you hate that non-customizable actionbar? With this tip, you can place your actionbar wherever you want, in what colour you want and whatever site you want.

Just put this in the onLoad event of the form:


var oTable = document.forms[0].children[0];
if (oTable && oTable.tagName== "TABLE")   {
		document.forms[0].children[0].className = "actionBar";

This little piece of code checks if there is an actionbar, and if so, it assigns a class to the table.

STEP 2: Put this in the HTML HEAD or create an external css file:

Table.actionBar {
	font-size 			: 95%;
    background:		rgb(120,172,255);
    width: 100%;
	border-collapse 		: collapse;
	margin 				: 20px 15px 20px;
	border 				: 1px solid;
    margin:60px 0px 10px 0px;
	padding: 17px 0px 0px 20px;
	height:33px; /* 14px + 17px + 2px = 33px */
	border-width:1px  1px; /* top and bottom borders: 1px; left and right borders: 0px */

Table.actionBar a, Table.actionBar a:visited {
	color:				black;
	border:				1px solid rgb(120,172,255);/*rgb(255,128,0);*/
	text-decoration:	none;
	padding:			1px;
	padding-left:		5px;
	padding-right:		5px;

.actionBar TD,Table.actionBar a:hover {
	color:			black;
	background:		rgb(120,172,255);
	border-left:	1px solid rgb(234,242,255);/*#ffcc88;*/
	border-right:	1px solid rgb(0,66,174);/*#884400;*/
	border-top:		1px solid rgb(234,242,255);/*#ffcc88;*/
	border-bottom:	1px solid rgb(0,66,174);/*#884400;*/


If you want another color, just change the values. Have fun with it.

This was first published in September 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.