Dataview web parts use xsl to form XML into tables and rows. This can also be used to sort the content. You can add code at a ASPX page in designer. This question has been answered before. Here is the post link were it was answered.
Gary Newman MCSE, MCT, CCNA MCDBA, MCAD, MCSA MCTS SharePoint 2007 Dev & Admin MCPD SharePoint 2010 Development