set flexible tab weight according to the number of tabs