Set Table Width Implicitly

Set Table Width Implicitly

Hi.  I have a jQuery that works.  It does what it's supposed to do.  It takes a long menu bar on a SharePoint web page and splits it into two menu bars.  However, the two tables that contain the two menu bars are not rendered with the same width and it looks funny.  At the end of this jQuery, I'd like to set the two tables to the same width.  I believe either pixels or a percentage would do the trick.  I tried searching this forum for an example of setting table with and did not find one.  Thanks in advance for any help


  1. $(document).ready(function() { 
  2.   // Calculate where to split the tables of the menus 
  3.   var nrOfItems = ($("#zz1_TopNavigationMenu *.zz1_TopNavigationMenu_5 > tbody > tr > td").length) / 3; 
  4.   var splitIndex = (Math.round(nrOfItems / 2) - 1) * 3; 
  5.   // Make a copy of the TopNavigationMenu 
  6.   $("#zz1_TopNavigationMenu").clone(true).insertAfter($("#zz1_TopNavigationMenu")).attr("id", "zz1_TopNavigationMenuCopy"); 
  7.   // Remove items from original menu 
  8.   $("#zz1_TopNavigationMenu *.zz1_TopNavigationMenu_5 > tbody > tr > td:gt(" + splitIndex + ")").remove(); 
  9.   // Remove items from copied menu 
  10.   $("#zz1_TopNavigationMenuCopy > tbody > tr > td:lt(2)").remove();
  11.   // Remove first item (current site) from copied men 
  12.   $("#zz1_TopNavigationMenuCopy *.zz1_TopNavigationMenu_5 > tbody > tr > td:lt(" + (splitIndex + 1) + ")").remove(); 
  13. });