Most of these responces are incorrect. Yes most nutrients are absorbed in small intestine and colon is responsible for absorbing water, but this statement is misleading. Colon basically absorbs ONLY water to solidify waste by removing excess water not absorbed by small intestine (SI abbreviation from here on).
SI absorbs roughly 80% of water in consumed food and drink, and can also secrete water if needed. The absorption relies on several factors, mainly presence of sodium. Na is absorbed then re-secreted in small areas between folds of interrior lining. This Na electrolyte gradient forces water via osmosis into the cells as the cell now has a much lower concentration of Na ions. The innitial sodium mechanism is also dependant on the presence of glucose and amino acids, so diarrhea can occur if proper intake of these things are not balanced. Magnesium plays a major role in the colon controlling water absorption or secretion as well, this is why most all OTC meds for constapation contain high amounts of Mg in form of usually mag. hydroxide. The hydroxide neutralizes stomach acid to ease discomfort while releasing high amounts of Mg ions. Once in colon, this works in reverse as the [Mg+2] is now much higher in colon waste than cells, forcing reverse osmosis pumping water into colon from cells which hydrates and softens stool.