Saturday, October 27, 2012

How to center align horizontal

HTML

<div id="horizontal-menu">
      <ul>
            <li><a href='#'>Link 1</a></li>
            <li><a href='#'>Link 2</a></li>
            <li><a href='#'>Link 3</a></li>
            <li><a href='#'>Link 4</a></li>
      </ul>
</div>

CSS

<style type="text/css">
    .footer-menu { positionrelativeleft-50%floatright; }
    .footer-menu ul { positionrelativeleft50%; }
    .footer-menu ul li { displayblockfloatleftpositionrelative; }
    .footer-menu ul li a { displayblockwhite-spacenowrap; }
</style>

 That's all folks

Saturday, July 14, 2012

join Name Value Collection Keys and values asp dot net

NameValueCollection nvc = new NameValueCollection(); 
//Fill collection
string sql=""; 

sql = "INSERT INTO [TABLENAME]";

//Join all keys with ],[ as seperator
sql += string.Format(" ([{0}])"string.Join("],[", nvc.AllKeys));
//Join all values with ',' as seperator 
sql += string.Format(" VALUES('{0}')"string.Join("','", nvc.AllKeys.Select(key => nvc[key]))); 
 
 

Converting byte[] to string in asp dot net c#

string str = System.Text.Encoding.UTF8.GetString( byte[] arr );

Monday, July 9, 2012

HTML5 equivalent of cellpadding, cellspacing, valign, and align?

/*cellpadding*/
thtd { padding0; }
 
/* cellspacing */
table { border-collapse:separateborder-spacing0; }
 
/* valign */
thtd { vertical-aligntop|middle|bottom; }
 
/* align (center)
   width of table must be less than the parent container */
table { margin0 auto; }